Skip to content

Commit

Permalink
Merge pull request vpulim#571 from andrewbranch/fix-strict-mode-errors
Browse files Browse the repository at this point in the history
Configure for v0.12 and io.js compatibility
  • Loading branch information
herom committed Feb 17, 2015
2 parents 08ea519 + 314ff00 commit 14ac36a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ language: node_js
node_js:
- 0.8
- 0.10
- 0.12
- iojs
before_install:
- npm install -g npm@~1.4.6
15 changes: 11 additions & 4 deletions lib/wsdl.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,12 @@ MessageElement.prototype.postProcess = function(definitions) {
} else {
this.parts[part.$name] = part.$type;
}
this.parts[part.$name].namespace = nsName.namespace;
this.parts[part.$name].xmlns = ns;

if (typeof this.parts[part.$name] === 'object') {
this.parts[part.$name].namespace = nsName.namespace;
this.parts[part.$name].xmlns = ns;
}

this.children.splice(i--, 1);
}
}
Expand Down Expand Up @@ -869,8 +873,11 @@ ElementElement.prototype.description = function(definitions, xmlns) {
else {
elem = element[name] = typeElement.description(definitions, xmlns);
}
elem.targetNSAlias = type.namespace;
elem.targetNamespace = ns;

if (typeof elem === 'object') {
elem.targetNSAlias = type.namespace;
elem.targetNamespace = ns;
}

definitions.descriptions.types[typeName] = elem;
}
Expand Down
2 changes: 1 addition & 1 deletion test/server-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('SOAP Server', function() {

//windows return 0.0.0.0 as address and that is not
//valid to use in a request
if (test.server.address().address === '0.0.0.0') {
if (test.server.address().address === '0.0.0.0' || test.server.address().address === '::') {
test.baseUrl =
'http://127.0.0.1:' + test.server.address().port;
}
Expand Down
5 changes: 5 additions & 0 deletions test/ssl-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ describe('SOAP Client(SSL)', function() {
test.soapServer = soap.listen(test.server, '/stockquote', test.service, test.wsdl);
test.baseUrl =
'https://' + test.server.address().address + ':' + test.server.address().port;

if (test.server.address().address === '0.0.0.0' || test.server.address().address === '::') {
test.baseUrl =
'https://127.0.0.1:' + test.server.address().port;
}
done();
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/wsdl/connection/econnrefused.wsdl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<wsdl:types>
<xsd:schema>
<xsd:import namespace="http://example.com/stockquote.xsd" schemaLocation="http://localhost:0"></xsd:import>
<xsd:import namespace="http://example.com/stockquote.xsd" schemaLocation="http://localhost:1"></xsd:import>
</xsd:schema>
<xsd:schema targetNamespace="http://example.com/stockquote.xsd" xmlns:xsd="http://www.w3.org/2000/10/XMLSchema">
<xsd:element name="TradePriceRequest">
Expand Down

0 comments on commit 14ac36a

Please sign in to comment.