Permalink
Browse files

Arrays are also parsed if they aren't listed as this in the wsdl

  • Loading branch information...
1 parent d8620eb commit d6d311d5e6e92b4ddc2d290d7e906e315a9909f7 Gordon Tschirner committed Mar 11, 2011
Showing with 9 additions and 1 deletion.
  1. +9 −1 soapclient.js
View
10 soapclient.js
@@ -259,7 +259,15 @@ SOAPClient._node2object = function(node, wsdlTypes)
// leaf node
if (node.childNodes.length == 1 && (node.childNodes[0].nodeType == 3 || node.childNodes[0].nodeType == 4))
return SOAPClient._node2object(node.childNodes[0], wsdlTypes);
- var isarray = SOAPClient._getTypeFromWsdl(node.nodeName, wsdlTypes).toLowerCase().indexOf("arrayof") != -1;
+ var isArray = false;
+ var tmpNodeNameObject = new Object;
+ for(var i = 0; !isArray && i< node.childNodes.length; i++) {
+ if(typeof tmpNodeNameObject[node.childNodes[i].nodeName] == "undefined")
+ tmpNodeNameObject[node.childNodes[i].nodeName] = true;
+ else isArray = true;
+
+ }
+ var isarray = isArray || SOAPClient._getTypeFromWsdl(node.nodeName, wsdlTypes).toLowerCase().indexOf("arrayof") != -1;
// object node
if(!isarray)
{

0 comments on commit d6d311d

Please sign in to comment.