节点soapxml语法
我正在尝试使用node.js中使用和wsdl定义的SOAP Web服务 现在,关于singlewsdl规范的这一部分:节点soapxml语法,xml,node.js,soap,wsdl,soap-client,Xml,Node.js,Soap,Wsdl,Soap Client,我正在尝试使用node.js中使用和wsdl定义的SOAP Web服务 现在,关于singlewsdl规范的这一部分: <xs:element minOccurs="0" name="AuthToken" nillable="true" type="xs:string"/> <xs:element xmlns:q1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" minOccurs="0" name="NI
<xs:element minOccurs="0" name="AuthToken" nillable="true" type="xs:string"/>
<xs:element xmlns:q1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" minOccurs="0" name="NIP" nillable="true" type="q1:ArrayOfstring"/>
...
<xs:element minOccurs="0" name="DateFrom" nillable="true" type="xs:dateTime"/>
但我不知道“ArrayOf…”参数的语法应该是什么样子。我试过:
NIP: 'xxxx'
NIP: {
element: 'xxxx'
}
NIP: {
string: 'xxxx'
}
然而,只有第一个产生反序列化错误,前者只产生超时(这与随机参数相同)
任何帮助都将不胜感激。帮助我了解到:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<soapenv:Header/>
<soapenv:Body>
<tem:GetData>
<tem:AuthToken>xxxx</tem:AuthToken>
<tem:NIP>
<arr:string>yyyy</arr:string>
<arr:string>zzzz</arr:string>
</tem:NIP>
</tem:GetData>
</soapenv:Body>
</soapenv:Envelope>
作为注释-默认情况下将名称空间定义为“tns”,因此我跳过了SoapUI建议的“tem”定义
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<soapenv:Header/>
<soapenv:Body>
<tem:GetData>
<tem:AuthToken>xxxx</tem:AuthToken>
<tem:NIP>
<arr:string>yyyy</arr:string>
<arr:string>zzzz</arr:string>
</tem:NIP>
</tem:GetData>
</soapenv:Body>
</soapenv:Envelope>
var args = {
attributes: {
'xmlns:arr': 'http://schemas.microsoft.com/2003/10/Serialization/Arrays'
},
'tns:AuthToken': 'xxxx',
'tns:NIP': {
'arr:string': ['yyyy','zzzz']
},
};