jQuery SOAP Client 介绍
This is a jQuery implementation of SOAP Client and it is based on another
jQuery plug-in called xmlObjectifier.
This library provides an easy way to communicate with SOAP web services from
the client-side javascript (all domain restrictions are still there).
SOAPClient supports complex/nested request objects as well as attributes and
values within request object nodes. You can also set Header objects as well.
Practical example of how to use SOAPClient can be found on my site by
following Demo link. I also have included a simple ASP.NET Proxy example that
will resolve Cross-Browser Restrictions (if you’re running IIS w/ ASP.NET)
Example
var soapBody = new SOAPObject(“testObject”); //Create a new request object
soapBody.attr(“type”,”test”); //Setting attributes of that object
soapBody.val(“Hello World”); //Setting value of that object
//You can also use chained method that looks like this:
// var soapBody = new SOAPObject(“testObject”).attr(“type”,”test”).val(“Hello
World”);
//Create a new SOAP Request
var sr = new SOAPRequest(“MyAction”, soapBody); //Request is ready to be sent
//Lets send it
SOAPClient.Proxy = "http://my-ws.com/webservice/”; //Specify web-service
address or a proxy file
SOAPClient.SendRequest(sr, processResponse); //Send request to server and
assign a callback
function processResponse(respObj) {
//respObj is a JSON equivalent of SOAP Response XML (all namespaces are
dropped)
//… do something with response
}
jQuery SOAP Client 官网
http://plugins.jquery.com/project/jqSOAPClient
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。