2014-02-14 131 views
0

如果你已經有了一個WSDL爲指向的東西如何產生如下XML肥皂從Node.js的

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cred="http://credential.transport.v1.api.cmpublish.clickability.com" xmlns:tran="http://transport.v1.api.cmpublish.clickability.com"> 
    <soapenv:Header> 
     <cred:credentials username="" password="" customerID=""/> 
    </soapenv:Header> 
    <soapenv:Body> 
     <tran:getSubscriberByEmail> 
     <email></email> 
     <domainID></domainID> 
     </tran:getSubscriberByEmail> 
    </soapenv:Body> 
</soapenv:Envelope> 

回答

1

在node.js的SOAP請求,我發現node-soap是直線前進。

從他們的自述:

var soap = require('soap'); 
var url = 'http://example.com/wsdl?wsdl'; 
var args = {name: 'value'}; 
soap.createClient(url, function(err, client) { 
    client.MyFunction(args, function(err, result) { 
     console.log(result); 
    }); 
});