Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using targetNamespace of the attribute if present #32

Merged
merged 1 commit into from
Oct 19, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Using targetNamespace of the attribute if present
Guatom committed Oct 13, 2016
commit 140998b887df6ab8fd9ae25a8d0e3b17fbfaa0a6
2 changes: 1 addition & 1 deletion src/parser/element.js
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ class Element {
if (ElementType) {
child = new ElementType(nsName, attrs, options);
child.nsURI = qname.nsURI;
child.targetNamespace = this.getTargetNamespace();
child.targetNamespace = attrs.targetNamespace || this.getTargetNamespace();
debug('Element created: ', child);
child.parent = parent;
stack.push(child);
4 changes: 2 additions & 2 deletions test/client-customHttp-xsdinclude-test.js
Original file line number Diff line number Diff line change
@@ -83,11 +83,11 @@ describe('custom http client', function() {
assert.equal(myOp.soapAction, 'tns#Dummy');

var reqElement = myOp.input.body.elements[0].qname;
assert.equal(reqElement.nsURI, 'http://www.dummy.com');
assert.equal(reqElement.nsURI, 'http://www.dummy.com/Types');
assert.equal(reqElement.name, 'DummyRequest');

var resElement = myOp.output.body.elements[0].qname;
assert.equal(resElement.nsURI, 'http://www.dummy.com');
assert.equal(resElement.nsURI, 'http://www.dummy.com/Types');
assert.equal(resElement.name, 'DummyResponse');

done();
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header/>
<soap:Body>
<ns1:TestMessage xmlns:ns1="http://example.com/testservice.wsdl">
<ns1:TestMessage xmlns:ns1="http://example.com/testservice.xsd">
<message><![CDATA[Hello World! & Hello Me!]]></message>
</ns1:TestMessage>
</soap:Body>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header/><soap:Body>
<ns1:Administrate xmlns:ns1="http://schemas.My.com/My11/wsdl">
<ns1:Administrate xmlns:ns1="http://schemas.My.com/My11">
<ns1:AdminOperation>
<ns1:CreateUser>
<ns1:User><ns1:Name>name</ns1:Name>
2 changes: 1 addition & 1 deletion test/server-client-document-test.js
Original file line number Diff line number Diff line change
@@ -577,7 +577,7 @@ describe('Document style tests', function() {
//check if fault exists with correct 'Detail' parameters in the response
var index = body.indexOf('<soap:Detail>');
assert.ok(index > -1);
var index = body.indexOf('ns1:myMethodFault2 xmlns:ns1="http://example.com/doc_literal_wrapped_test_soap12.wsdl"');
var index = body.indexOf('ns1:myMethodFault2 xmlns:ns1="http://example.com/doc_literal_wrapped_test_soap12.xsd"');
assert.ok(index > -1);
var index = body.indexOf('<errorMessage2>MyMethod Business Exception message</errorMessage2>');
assert.ok(index > -1);
2 changes: 1 addition & 1 deletion test/server-options-test.js
Original file line number Diff line number Diff line change
@@ -158,7 +158,7 @@ describe('SOAP Server with Options', function() {


it('should return correct stock price in response body', function(done) {
var responseData = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n <soap:Header/>\n <soap:Body>\n <ns1:TradePrice xmlns:ns1=\"http://example.com/stockquote.wsdl\">\n <price>19.56</price>\n </ns1:TradePrice>\n </soap:Body>\n</soap:Envelope>';
var responseData = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n <soap:Header/>\n <soap:Body>\n <ns1:TradePrice xmlns:ns1=\"http://example.com/stockquote.xsd\">\n <price>19.56</price>\n </ns1:TradePrice>\n </soap:Body>\n</soap:Envelope>';
test.server.listen(15099, null, null, function() {
test.soapServer = soap.listen(test.server, {
path: '/stockquote',