diff --git a/src/wsdl/elements.ts b/src/wsdl/elements.ts index ab653f857..6478d6923 100644 --- a/src/wsdl/elements.ts +++ b/src/wsdl/elements.ts @@ -665,12 +665,19 @@ export class MessageElement extends Element { const ns = nsName.prefix; let schema = definitions.schemas[definitions.xmlns[ns]]; this.element = schema.elements[nsName.name]; + let schemaToLookup; + if (!this.element) { + // Try to find it another way + schemaToLookup = part.xmlns; + schema = definitions.schemas[schemaToLookup[Object.keys(schemaToLookup)[0]]]; + this.element = schema.elements[nsName.name]; + } if (!this.element) { debug(nsName.name + ' is not present in wsdl and cannot be processed correctly.'); return; } this.element.targetNSAlias = ns; - this.element.targetNamespace = definitions.xmlns[ns]; + this.element.targetNamespace = (schemaToLookup && schemaToLookup.xsns) || definitions.xmlns[ns]; // set the optional $lookupType to be used within `client#_invoke()` when // calling `wsdl#objectToDocumentXML() diff --git a/test/request-response-samples/fooOp__should_return_back_good_response_object/bar.xsd b/test/request-response-samples/fooOp__should_return_back_good_response_object/bar.xsd new file mode 100644 index 000000000..092a6630b --- /dev/null +++ b/test/request-response-samples/fooOp__should_return_back_good_response_object/bar.xsd @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/test/request-response-samples/fooOp__should_return_back_good_response_object/bar1.xsd b/test/request-response-samples/fooOp__should_return_back_good_response_object/bar1.xsd new file mode 100644 index 000000000..6f100c5cd --- /dev/null +++ b/test/request-response-samples/fooOp__should_return_back_good_response_object/bar1.xsd @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/request-response-samples/fooOp__should_return_back_good_response_object/request.json b/test/request-response-samples/fooOp__should_return_back_good_response_object/request.json new file mode 100644 index 000000000..154258344 --- /dev/null +++ b/test/request-response-samples/fooOp__should_return_back_good_response_object/request.json @@ -0,0 +1,5 @@ +{ + "requestHeader": { + "requestId": "79d9372c-d2fe-4f86-a637-d1f5710bb439" + } +} \ No newline at end of file diff --git a/test/request-response-samples/fooOp__should_return_back_good_response_object/request.xml b/test/request-response-samples/fooOp__should_return_back_good_response_object/request.xml new file mode 100644 index 000000000..a6be2a236 --- /dev/null +++ b/test/request-response-samples/fooOp__should_return_back_good_response_object/request.xml @@ -0,0 +1 @@ +79d9372c-d2fe-4f86-a637-d1f5710bb439 \ No newline at end of file diff --git a/test/request-response-samples/fooOp__should_return_back_good_response_object/response.xml b/test/request-response-samples/fooOp__should_return_back_good_response_object/response.xml new file mode 100644 index 000000000..ad5149051 --- /dev/null +++ b/test/request-response-samples/fooOp__should_return_back_good_response_object/response.xml @@ -0,0 +1,10 @@ + + + + + + 79d9372c-d2fe-4f86-a637-d1f5710bb439 + + + + \ No newline at end of file diff --git a/test/request-response-samples/fooOp__should_return_back_good_response_object/soap.wsdl b/test/request-response-samples/fooOp__should_return_back_good_response_object/soap.wsdl new file mode 100755 index 000000000..e27932325 --- /dev/null +++ b/test/request-response-samples/fooOp__should_return_back_good_response_object/soap.wsdl @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +