Comparing version 0.9.3 to 0.9.4
@@ -0,1 +1,12 @@ | ||
0.9.4 / 2015-09-28 | ||
================= | ||
[MAINTENANCE] Adding node v4.0 to .travis.yml. (#729) | ||
[MAINTENANCE] Increasing mocha test timeout to 10 seconds. (#732) | ||
[FIX] Resolve element references when other types are referenced. (#725) | ||
[DOC] Update Readme.md | ||
[ENHANCEMENT] New Ignorebasenamespaces option. (#716) | ||
[ENHANCEMENT] Add optional statusCode on soap fault. (#715) | ||
[FIX] Fix for wsdl retrieval using soap.createClient with special options.httpClient. Before this, the specified client was not used when fetching the wsdl file. This fix will force the wsdl to use the specified httpClient. (#714) | ||
[FIX] Allow WSDL to be loaded from HTTPS sites. (#694) | ||
0.9.3 / 2015-09-08 | ||
@@ -2,0 +13,0 @@ ================= |
@@ -123,3 +123,6 @@ /* | ||
} | ||
self._process(xml, req.url, function(result) { | ||
self._process(xml, req.url, function(result, statusCode) { | ||
if(statusCode) { | ||
res.statusCode = statusCode; | ||
} | ||
res.write(result); | ||
@@ -338,2 +341,8 @@ res.end(); | ||
var statusCode; | ||
if(soapFault.statusCode) { | ||
statusCode = soapFault.statusCode; | ||
soapFault.statusCode = undefined; | ||
} | ||
if (soapFault.faultcode) { | ||
@@ -352,5 +361,5 @@ // Soap 1.1 error style | ||
return callback(self._envelope(fault, includeTimestamp)); | ||
return callback(self._envelope(fault, includeTimestamp), statusCode); | ||
}; | ||
exports.Server = Server; |
@@ -1078,2 +1078,4 @@ /* | ||
WSDL.prototype.ignoreBaseNameSpaces = false; | ||
WSDL.prototype.valueKey = '$value'; | ||
@@ -1104,2 +1106,9 @@ WSDL.prototype.xmlKey = '$xml'; | ||
this.options.wsdl_options = options.wsdl_options; | ||
var ignoreBaseNameSpaces = options ? options.ignoreBaseNameSpaces : null; | ||
if(ignoreBaseNameSpaces !== null && typeof ignoreBaseNameSpaces !== 'undefined' ) | ||
this.options.ignoreBaseNameSpaces = ignoreBaseNameSpaces; | ||
else | ||
this.options.ignoreBaseNameSpaces = this.ignoreBaseNameSpaces; | ||
}; | ||
@@ -1120,3 +1129,3 @@ | ||
var includePath; | ||
if (!/^http/.test(self.uri) && !/^http/.test(include.location)) { | ||
if (!/^https?/.test(self.uri) && !/^https?/.test(include.location)) { | ||
includePath = path.resolve(path.dirname(self.uri), include.location); | ||
@@ -1572,3 +1581,6 @@ } else { | ||
childParameterTypeObject.$ref)) { | ||
if(childParameterTypeObject.$baseNameSpace) { //this element has a base with another namespace (the correct one) | ||
/*if the base name space of the children is not in the ingoredSchemaNamspaces we use it. | ||
This is because in some services the child nodes do not need the baseNameSpace. | ||
*/ | ||
if(childParameterTypeObject.$baseNameSpace && !this.options.ignoreBaseNameSpaces) { | ||
ns = childParameterTypeObject.$baseNameSpace + ':'; | ||
@@ -1719,3 +1731,3 @@ } | ||
if(parameterTypeObj.$lookupTypes && Array.isArray(parameterTypeObj.$lookupTypes) && parameterTypeObj.$lookupTypes.length) { | ||
if(Array.isArray(parameterTypeObj.$lookupTypes) && parameterTypeObj.$lookupTypes.length) { | ||
var types = parameterTypeObj.$lookupTypes; | ||
@@ -1730,43 +1742,36 @@ | ||
} | ||
if(typeObj.$ref) { | ||
ref = splitNSName(typeObj.$ref); | ||
if (ref.name === childName) { | ||
found = typeObj; | ||
break; | ||
} | ||
} | ||
} | ||
} else { | ||
var object = parameterTypeObj; | ||
if (object.$name === childName) { | ||
} | ||
var object = parameterTypeObj; | ||
if (object.$name === childName) { | ||
return object; | ||
} | ||
if (object.$ref) { | ||
ref = splitNSName(object.$ref); | ||
if (ref.name === childName) { | ||
return object; | ||
} | ||
if (object.$ref) { | ||
ref = splitNSName(object.$ref); | ||
if (ref.name === childName) { | ||
return object; | ||
} | ||
if (object.children) { | ||
for (i = 0, child; child = object.children[i]; i++) { | ||
found = this.findChildParameterObject(child, childName); | ||
if (found) { | ||
break; | ||
} | ||
} | ||
if (object.children) { | ||
for (i = 0, child; child = object.children[i]; i++) { | ||
found = this.findChildParameterObject(child, childName); | ||
if (found) { | ||
break; | ||
} | ||
if (child.$base) { | ||
var childNameSpace = child.$base.substr(0, child.$base.indexOf(':')), | ||
childXmlns = this.definitions.xmlns[childNameSpace]; | ||
if(child.$base) { | ||
var childNameSpace = child.$base.substr(0, child.$base.indexOf(':')), | ||
childXmlns = this.definitions.xmlns[childNameSpace]; | ||
var foundBase = this.findChildParameterObjectFromSchema(child.$base.substr(child.$base.indexOf(':') + 1), childXmlns); | ||
var foundBase = this.findChildParameterObjectFromSchema(child.$base.substr(child.$base.indexOf(':') + 1), childXmlns); | ||
if (foundBase) { | ||
found = this.findChildParameterObject(foundBase, childName); | ||
if (foundBase) { | ||
found = this.findChildParameterObject(foundBase, childName); | ||
if (found) { | ||
found.$baseNameSpace = childNameSpace; | ||
found.$type = childNameSpace + ':' + childName; | ||
break; | ||
} | ||
if (found) { | ||
found.$baseNameSpace = childNameSpace; | ||
found.$type = childNameSpace + ':' + childName; | ||
break; | ||
} | ||
@@ -1776,2 +1781,3 @@ } | ||
} | ||
} | ||
@@ -1889,3 +1895,3 @@ | ||
var wsdl; | ||
if (!/^http/.test(uri)) { | ||
if (!/^https?/.test(uri)) { | ||
debug('Reading file: %s', uri); | ||
@@ -1904,3 +1910,3 @@ fs.readFile(uri, 'utf8', function(err, definition) { | ||
debug('Reading url: %s', uri); | ||
var httpClient = new HttpClient(options); | ||
var httpClient = options.httpClient || new HttpClient(options); | ||
httpClient.request(uri, null /* options */, function(err, response, definition) { | ||
@@ -1907,0 +1913,0 @@ if (err) { |
{ | ||
"name": "soap", | ||
"version": "0.9.3", | ||
"version": "0.9.4", | ||
"description": "A minimal node SOAP client", | ||
@@ -27,3 +27,3 @@ "engines": { | ||
"pretest": "jshint index.js lib test", | ||
"test": "mocha test/*-test.js test/security/*.js" | ||
"test": "mocha --timeout 10000 test/*-test.js test/security/*.js" | ||
}, | ||
@@ -39,4 +39,7 @@ "keywords": [ | ||
"should": "~3.3.0", | ||
"timekeeper": "~0.0.4" | ||
"timekeeper": "~0.0.4", | ||
"duplexer": "~0.1.1", | ||
"readable-stream": "~2.0.2", | ||
"semver": "~5.0.3" | ||
} | ||
} |
@@ -125,2 +125,17 @@ # Soap [![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] | ||
To change the HTTP statusCode of the response include it on the fault. The statusCode property will not be put on the xml message. | ||
``` javascript | ||
throw { | ||
Fault: { | ||
Code: { | ||
Value: "soap:Sender", | ||
Subcode: { value: "rpc:BadArguments" } | ||
}, | ||
Reason: { Text: "Processing Error" }, | ||
statusCode: 500 | ||
} | ||
}; | ||
``` | ||
### SOAP Headers | ||
@@ -453,6 +468,35 @@ | ||
If you want to override the default ignored namespaces you would simply pass the following `ignoredNamespaces` object within the `options`: | ||
``` | ||
var options = { | ||
ignoredNamespaces: { | ||
namespaces: ['namespaceToIgnore', 'someOtherNamespace'], | ||
override: true | ||
} | ||
} | ||
``` | ||
This would override the default `ignoredNamespaces` of the `WSDL` processor to `['namespaceToIgnore', 'someOtherNamespace']`. (This shouldn't be necessary, anyways). | ||
## Handling "ignoreBaseNameSpaces" attribute | ||
If an Element in a `schema` definition depends has a basenamespace defined but the request does not need that value, for example you have a "sentJob" with basenamespace "v20" | ||
but the request need only: <sendJob> set in the tree structure, you need to set the ignoreBaseNameSpaces to true. This is set because in a lot of workaround the wsdl structure is not correctly | ||
set or the webservice bring errors. | ||
By default the attribute is set to true. | ||
An example to use: | ||
A simple `ignoredNamespaces` object, which only adds certain namespaces could look like this: | ||
``` | ||
var options = { | ||
ignoredNamespaces: true | ||
} | ||
``` | ||
## Contributors | ||
* Author: [Vinay Pulim](https://github.com/vpulim) | ||
* Lead Maintainer: [Joe Spencer](https://github.com/jsdevel) | ||
* Maintainers: | ||
- [Joe Spencer](https://github.com/jsdevel) | ||
- [Heinz Romirer](https://github.com/herom) | ||
* [All Contributors](https://github.com/vpulim/node-soap/graphs/contributors) | ||
@@ -459,0 +503,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
124133
2577
508
8