如何在node-soap中使用派生types
我使用Node Soap https://github.com/vpulim/node-soap发送SOAP请求并parsing答案。
现在我有一个派生types的服务<searchedAddress xsi:type="PersonAddressDescription">
。
如何在我的请求中指定xsi:type="PersonAddressDescription"
?
这就是我所做的
const args = { searchedAddress: { location: { street: 'Karl-Theorstraße 88', zip: '34234', city: 'Rummelshausen' }, firstName: 'Foo', lastName: 'Bar' } } soap.createClient(WSDL, wsdlOptions, (err, client) => { client.getReport(args, (err, result) => { if (err !== null) { console.log(client.lastRequest) reject(err) } resolve(result) }) })
这就是请求的样子:
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <soap:Header/> <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <getReportRequest xmlns="http://www.service.com/superservice/v1.00"> <searchedAddress xsi:type="PersonAddressDescription"> <location> <street>Karl-Theorstraße 88</street> <zip>34234</zip> <city>Rummelshausen</city> </location> <firstName>Foo</firstName> <lastName>Bar</lastName> </searchedAddress> </getReportRequest> </s:Body> </s:Envelope>
尝试添加attributes
到您请求的节点。 从这里
const args = { searchedAddress: { attributes: { 'xsi:type': 'PersonAddressDescription' }, location: { street: 'Karl-Theorstraße 88', zip: '34234', city: 'Rummelshausen' }, firstName: 'Foo', lastName: 'Bar' } }
- socket.io-client是否适合作为XSockets.NET服务器的套接字客户端?
- Node js – Socket.io-client没有连接到socket.io服务器
- https.createServer忽略ca数组
- Visual Studio node.js构build设置
- 未被捕获的meteor中的types错误
- 如何将parameter passing给一个mysql存储过程,并将存储过程的结果返回到nodejs代码中
- 从C#控制台应用程序中使用Edge.js
- 节点JS – Express JS – TypeError:对象#<对象>没有方法'编译'
- jQuery,为触发事件的元素findselect器