usebruno/bruno · error · Error
No definitions found in WSDL
Error message
No definitions found in WSDL
What it means
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.
Source
Thrown at packages/bruno-converters/src/wsdl/wsdl-to-bruno.js:151
this.elements = new Map();
this.complexTypes = new Map();
this.simpleTypes = new Map();
this.messages = new Map();
this.portTypes = new Map();
this.bindings = new Map();
this.services = new Map();
this.namespaces = new Map();
}
/**
* Parse WSDL content and extract all components
*/
async parse(wsdlContent) {
const result = await parseXML(wsdlContent);
const definitions = result['wsdl:definitions'] || result.definitions;
if (!definitions) {
throw new Error('No definitions found in WSDL');
}
// Extract namespaces
this.extractNamespaces(definitions);
// Parse types (XSD schemas)
if (definitions['wsdl:types'] || definitions.types) {
this.parseTypes(definitions['wsdl:types'] || definitions.types);
}
// Parse messages
this.parseMessages(definitions);
// Parse port types
this.parsePortTypes(definitions);
// Parse bindings
this.parseBindings(definitions);View on GitHub (pinned to 9bdd81c7bd)
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.
Example fix
// before
await wsdlToBruno(xsdContent); // XSD has no definitions
// after
if (!/<wsdl:definitions|<definitions[\s>]/.test(wsdlContent)) {
throw new Error('Input does not look like WSDL (no <definitions> root)');
}
await wsdlToBruno(wsdlContent); Defensive patterns
Strategy: validation
Validate before calling
const looksLikeWsdl = (s) => typeof s === 'string' && /<wsdl:definitions[\s>]|<definitions[\s>]/.test(s);
Type guard
const isWsdlContent = (s) => typeof s === 'string' && /<wsdl:definitions[\s>]|<definitions[\s>]/.test(s);
Try / catch
try {
return await wsdlToBruno(content);
} catch (e) {
if (/No definitions found/.test(e.message)) {
throw new Error('File is not a WSDL document (no <definitions> root).');
}
throw e;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- The Collection has an invalid schema: ${err.message}
- Import WSDL collection failed: ${err.message}
- Invalid environment: expected an object
- Invalid environment: missing or invalid variables array
- Invalid variable at index ${index}: expected an object
AI-assisted analysis of usebruno/bruno@9bdd81c7bd (2026-08-13).
Data as JSON: /api/errors/55a797f6d872dd42.
Report an issue: GitHub.