Comparing version 0.2.1 to 0.2.2
@@ -233,3 +233,9 @@ /* | ||
if (child.name === 'include' || child.name === 'import') { | ||
this.includes.push(child.$schemaLocation); | ||
var location = child.$schemaLocation || child.$location; | ||
if (location) { | ||
this.includes.push({ | ||
namespace: child.$namespace, | ||
location: location | ||
}); | ||
} | ||
} | ||
@@ -370,2 +376,3 @@ else if (child.name === 'complexType') { | ||
var children = this.children; | ||
if (typeof children === 'undefined') return; | ||
for (var i=0, child; child=children[i]; i++) { | ||
@@ -588,24 +595,28 @@ if (child.name != 'operation') continue; | ||
WSDL.prototype.processIncludes = function(callback) { | ||
WSDL.prototype._processNextInclude = function(includes, callback) { | ||
var self = this, | ||
uri = this.definitions && this.definitions.includes && this.definitions.includes.shift(); | ||
include = includes.shift(); | ||
if (!uri) { | ||
callback(null, this); | ||
return; | ||
} | ||
if (!include) return callback() | ||
open_wsdl(url.resolve(self.uri, uri), function(err, wsdl) { | ||
for (var name in wsdl.definitions.complexTypes) { | ||
self.definitions.complexTypes[name] = wsdl.definitions.complexTypes[name]; | ||
} | ||
for (var name in wsdl.definitions.types) { | ||
self.definitions.types[name] = wsdl.definitions.types[name]; | ||
} | ||
self.processIncludes(function(err, wsdl) { | ||
callback(err, wsdl); | ||
open_wsdl(url.resolve(self.uri, include.location), function(err, wsdl) { | ||
self.definitions.schemas[include.namespace] = wsdl.definitions; | ||
self._processNextInclude(includes, function(err) { | ||
callback(err); | ||
}) | ||
}); | ||
}); | ||
} | ||
WSDL.prototype.processIncludes = function(callback) { | ||
var schemas = this.definitions.schemas, | ||
includes = []; | ||
for (var ns in schemas) { | ||
var schema = schemas[ns]; | ||
includes = includes.concat(schema.includes || []) | ||
} | ||
this._processNextInclude(includes, callback); | ||
} | ||
WSDL.prototype.describeServices = function() { | ||
@@ -612,0 +623,0 @@ var services = {}; |
{ | ||
"name": "soap", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "A minimal node SOAP client", | ||
@@ -5,0 +5,0 @@ "engines": { "node": ">=0.6.0" }, |
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
189890
25
1806