{"record":{"id":"55a797f6d872dd42","repo":"usebruno/bruno","slug":"no-definitions-found-in-wsdl","errorCode":null,"errorMessage":"No definitions found in WSDL","messagePattern":"No definitions found in WSDL","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-converters/src/wsdl/wsdl-to-bruno.js","lineNumber":151,"sourceCode":"    this.elements = new Map();\n    this.complexTypes = new Map();\n    this.simpleTypes = new Map();\n    this.messages = new Map();\n    this.portTypes = new Map();\n    this.bindings = new Map();\n    this.services = new Map();\n    this.namespaces = new Map();\n  }\n\n  /**\n   * Parse WSDL content and extract all components\n   */\n  async parse(wsdlContent) {\n    const result = await parseXML(wsdlContent);\n    const definitions = result['wsdl:definitions'] || result.definitions;\n\n    if (!definitions) {\n      throw new Error('No definitions found in WSDL');\n    }\n\n    // Extract namespaces\n    this.extractNamespaces(definitions);\n\n    // Parse types (XSD schemas)\n    if (definitions['wsdl:types'] || definitions.types) {\n      this.parseTypes(definitions['wsdl:types'] || definitions.types);\n    }\n\n    // Parse messages\n    this.parseMessages(definitions);\n\n    // Parse port types\n    this.parsePortTypes(definitions);\n\n    // Parse bindings\n    this.parseBindings(definitions);","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-converters/src/wsdl/wsdl-to-bruno.js#L133-L169","documentation":"Thrown by WSDLParser.parse after parseXML returns an object that has neither a 'wsdl:definitions' nor a 'definitions' key at its root. This means the parsed XML is not a WSDL document (or uses an unexpected root element/namespace). The parser hard-requires a definitions root to extract messages, portTypes, bindings, and services.","triggerScenarios":"Passing a plain XML file that is not WSDL (e.g. a bare XSD schema, an HTML error page, an SVG); a WSDL whose root element is named differently or lives under a different namespace prefix that the parser does not check; parseXML silently returning {} on malformed XML.","commonSituations":"Pointing the importer at an XSD file by mistake; downloading a WSDL URL that returned an HTML 404/500 page; a WSDL with a default namespace (no prefix) where the root key is 'definitions' but attributes differ.","solutions":["Verify the input is a WSDL: open it and confirm the root element is <wsdl:definitions> or <definitions>.","If the file is actually XSD, wrap it in a minimal WSDL or use an XSD-aware tool instead.","Check parseXML output by logging `result` keys before line 150 to see the actual root element name."],"exampleFix":"// before\nawait wsdlToBruno(xsdContent); // XSD has no definitions\n\n// after\nif (!/<wsdl:definitions|<definitions[\\s>]/.test(wsdlContent)) {\n  throw new Error('Input does not look like WSDL (no <definitions> root)');\n}\nawait wsdlToBruno(wsdlContent);","handlingStrategy":"validation","validationCode":"const looksLikeWsdl = (s) => typeof s === 'string' && /<wsdl:definitions[\\s>]|<definitions[\\s>]/.test(s);","typeGuard":"const isWsdlContent = (s) => typeof s === 'string' && /<wsdl:definitions[\\s>]|<definitions[\\s>]/.test(s);","tryCatchPattern":"try {\n  return await wsdlToBruno(content);\n} catch (e) {\n  if (/No definitions found/.test(e.message)) {\n    throw new Error('File is not a WSDL document (no <definitions> root).');\n  }\n  throw e;\n}","preventionTips":["Confirm the file root element is <wsdl:definitions> or <definitions> before import.","Do not pass XSD files to wsdlToBruno.","Check that downloaded WSDL content is not an HTML error page."],"tags":["wsdl","xml-parsing","import","bruno-converters","validation"],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}