From 6be862a6adf842ab5f57471ac997f706dc0adffa Mon Sep 17 00:00:00 2001 From: notatestuser Date: Wed, 18 Jan 2012 10:06:07 +0000 Subject: [PATCH] Amended SoapClient.lookupComplexType to work with a valid WSDL. In my file, an 'element' tag had the 'name' attribute containing the name of the type, whereby 'complexType' was a child containing its sequence of parameters. I've amended the XPath query to work with both structures as I assume [the creator] hasn't done it wrongly intentionally and your own WSDL might actually be formed the other way. --- lib/soap-client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/soap-client.js b/lib/soap-client.js index 35763f5..ff684be 100644 --- a/lib/soap-client.js +++ b/lib/soap-client.js @@ -186,7 +186,7 @@ SoapClient.prototype.resolveComplexType = function( typeName, doc, typeNamespace } SoapClient.prototype.lookupComplexType = function( typeName, doc, typeNamespace ){ - var paramSequenceLookup = "//xmlns:complexType[@name='"+typeName+"']/xmlns:sequence/xmlns:element"; + var paramSequenceLookup = "//xmlns:*[@name='"+typeName+"']//xmlns:sequence/xmlns:element"; paramSequence = doc.find(paramSequenceLookup, typeNamespace); return paramSequence; }