diff --git a/src/wsdl/elements.ts b/src/wsdl/elements.ts index dbd222678..25a6384fb 100644 --- a/src/wsdl/elements.ts +++ b/src/wsdl/elements.ts @@ -227,6 +227,7 @@ export class ElementElement extends Element { type = splitQName(type); const typeName: string = type.name; const ns: string = xmlns && xmlns[type.prefix] || + this.xmlns[type.prefix] || ((definitions.xmlns[type.prefix] !== undefined || definitions.xmlns[this.targetNSAlias] !== undefined) && this.schemaXmlns[type.prefix]) || definitions.xmlns[type.prefix]; const schema = definitions.schemas[ns]; diff --git a/test/wsdl-test.js b/test/wsdl-test.js index 22e8a474d..d08a666c4 100644 --- a/test/wsdl-test.js +++ b/test/wsdl-test.js @@ -242,6 +242,15 @@ describe('WSDL Parser (non-strict)', () => { }); }); + it('should load same namespace from included xsd with inline xmlns ', (done) => { + var expected = '{"DummyService":{"DummyPortType":{"Dummy":{"input":{"ID":"IdType|xs:string|pattern","Name":"NameType|xs:string|minLength,maxLength"},"output":{"Result":"dummy:DummyList"}}}}}'; + soap.createClient(__dirname + '/wsdl/xsdinclude/xsd_include_inline_xmlns.wsdl', function(err, client) { + assert.ifError(err); + assert.equal(JSON.stringify(client.describe()), expected); + done(); + }); + }); + it('should all attributes to root elements', (done) => { var expectedMsg = ' + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/xsdinclude/xsd_include_inline_xmlns.wsdl b/test/wsdl/xsdinclude/xsd_include_inline_xmlns.wsdl new file mode 100644 index 000000000..ea1651dc3 --- /dev/null +++ b/test/wsdl/xsdinclude/xsd_include_inline_xmlns.wsdl @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +