想要致电Soap Web服务

编程入门 行业动态 更新时间:2024-10-08 05:30:40
本文介绍了想要致电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服务

本文发布于:2023-11-12 02:09:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1580196.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Soap   Web

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!