nodejs xmlrpc错误:错误:XML-RPC错误:从input数据中find多个源模板:

我试图从节点应用程序消耗xmlrpc webservice( 摇头,往下看 ),我遇到了一些问题。 这是我想要发射的有效载荷:

<SOAP-ENV:Envelope xmlns:m="urn:ActionWebService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <VmProvisionRequest xmlns="urn:ActionWebService"> <version xsi:type="xsd:string">1.1</version> <templateFields xsi:type="xsd:string">blah blah</templateFields> <vmFields xsi:type="xsd:string">blah blah</vmFields> <requester xsi:type="xsd:string">blah blah</requester> <tags xsi:type="xsd:string"></tags> <options xsi:type="m:VmdbwsSupport..ProvisionOptions"> <values xsi:type="xsd:string"></values> <ems_custom_attributes xsi:type="xsd:string"></ems_custom_attributes> <miq_custom_attributes xsi:type="xsd:string">blah blah</miq_custom_attributes> </options> </VmProvisionRequest> </SOAP-ENV:Body> </SOAP-ENV:Envelope> 

但在节点的xmlrpc库中 ,当我在客户端上做一个methodCall时,我只能通过params(一个迭代的数组列表来生成序列化器中的xml)

这是我想要做的:

 var xmlrpc = require('xmlrpc') var request = '<SOAP-ENV:Envelope xmlns:m="urn:ActionWebService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'+ '<SOAP-ENV:Body>' + '<VmProvisionRequest xmlns="urn:ActionWebService">' + '<version xsi:type="xsd:string">1.1</version>' + '<templateFields xsi:type="xsd:string">blah blah</templateFields>' + '<vmFields xsi:type="xsd:string">blah blah</vmFields>' + '<requester xsi:type="xsd:string">blah blah</requester>' + '<tags xsi:type="xsd:string"></tags>' + '<options xsi:type="m:VmdbwsSupport..ProvisionOptions">' + '<values xsi:type="xsd:string"></values>' + '<ems_custom_attributes xsi:type="xsd:string"></ems_custom_attributes>' + '<miq_custom_attributes xsi:type="xsd:string">blah blah</miq_custom_attributes>' + '</options>' + '</VmProvisionRequest>' + '</SOAP-ENV:Body>' + '</SOAP-ENV:Envelope>' // Creates an XML-RPC client. Passes the host information on where to // make the XML-RPC calls. var clientOps = { host: 'myhost', port: 443, path: '/vmdbws/api', basic_auth: { user: 'username', pass: 'password', } }; var client = xmlrpc.createSecureClient(clientOps); // Sends a method call to the XML-RPC server client.methodCall('VmProvisionRequest', request, function (error, value) { if (error){ console.log(error); } // Results of the method response console.log('Method response for VmProvisionRequest: ' + value) }) 

我看到这个错误:

 DEBUG: Starting child process with 'node server.js' starting engines { [Error: XML-RPC fault: Multiple source template were found from input data:<{}>] code: 2, faultCode: 2, faultString: 'Multiple source template were found from input data:<{}>' } Method response for VmProvisionRequest: undefined DEBUG: Program node server.js exited with code 0 

任何想法我做错了什么? 任何帮助将不胜感激!