2013-02-19 62 views

回答

0

您可以使用jQuery的肥皂,使用SOAP

「這個腳本使用$就發送SOAP與Web服務通信的插件:信封它可以採取XML DOM,XML字符串或JSON作爲輸入並且響應可以作爲XML DOM,XML字符串或JSON返回。「

我還沒有嘗試過這一點,但它看起來很健壯,容易入門。

實施例:

$.soap({ 
    url: 'http://my.server.com/soapservices/', 
    method: 'helloWorld', 

data: { 
    name: 'Remy Blom', 
    msg: 'Hi!' 
}, 

success: function (soapResponse) { 
    // do stuff with soapResponse 
    // if you want to have the response as JSON use soapResponse.toJSON(); 
    // or soapResponse.toString() to get XML string 
    // or soapResponse.toXML() to get XML DOM 
}, 
error: function (SOAPResponse) { 
    // show error 
} 
}); 

源:https://github.com/doedje/jquery.soap