本文介绍了想要致电Soap Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨 我想调用基于soap的Web服务,我有一种简单的方法从该URL调用Web服务.. stackoverflow/questions/124269/simplest-soap-example-using-javascript [^ ] 但是我不知道在何处添加方法名称,以便它从服务中调用该方法,在Web服务中,有一些我想调用但无法调用的方法 你能帮我吗?
Hi i want to call soap based web service i got simple way to call web service from this url.. stackoverflow/questions/124269/simplest-soap-example-using-javascript[^] But i don''t understand where to add method name so that it call that method from service, in web service there are some method which i want to call but unable to call can you please help me..
<html> <head> <title>SOAP JavaScript Client Test</title> <script type="text/javascript"> function soap() { var xmlhttp = new XMLHttpRequest(); xmlhttp.open('POST', 'somesoapurl/', true); // build SOAP request var sr = '<?xml version="1.0" encoding="utf-8"?>' + '<soapenv:Envelope ' + 'xmlns:xsi="www.w3/2001/XMLSchema-instance" ' + 'xmlns:api="127.0.0.1/Integrics/Enswitch/API" ' + 'xmlns:xsd="www.w3/2001/XMLSchema" ' + 'xmlns:soapenv="schemas.xmlsoap/soap/envelope/">' + '<soapenv:Body>' + '<api:some_api_call soapenv:encodingStyle="schemas.xmlsoap/soap/encoding/">' + '<username xsi:type="xsd:string">login_username</username>' + '<password xsi:type="xsd:string">password</password>' + '</api:some_api_call>' + '</soapenv:Body>' + '</soapenv:Envelope>'; xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4) { if (xmlhttp.status == 200) { alert('done use firebug to see responce'); } } } // Send the POST request xmlhttp.setRequestHeader('Content-Type', 'text/xml'); xmlhttp.send(sr); // send request // ... } </script> </head> <body> <form name="Demo" action="" method="post"> <div> <input type="button" value="Soap" onclick="soap();" /> </div> </form> </body> <html>推荐答案
有特定于浏览器的代码,请访问,它可以处理几乎所有浏览器: code.google/p/xmlhttprequest/ [ ^ ] code.google/p/xmlhttprequest/downloads/detail?name = XMLHttpRequest.1.0.4.zip [ ^ ] There are browser specific codes, please visit, it handles almost all browsers: code.google/p/xmlhttprequest/[^] code.google/p/xmlhttprequest/downloads/detail?name=XMLHttpRequest.1.0.4.zip[^]
更多推荐
想要致电Soap Web服务
发布评论