How to post a SOAP request from a browser?

不羁的心 提交于 2019-12-30 09:23:31

问题


Is it possible to send a SOAP request directly from a browser to service provider? And then parse the output in javascript to show the result?

For example, if I've a SOAP request like this :

POST /InStock HTTP/1.1
Host: www.example.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">

<soap:Body xmlns:m="http://www.example.org/stock">
  <m:GetStockPrice>
    <m:StockName>IBM</m:StockName>
  </m:GetStockPrice>
</soap:Body>

</soap:Envelope>

Then can I get the 'IBM stock price' by clicking on a link on a web page? And show result after xml processing.


回答1:


It sounds like what you're looking for is a JavaScript SOAP library.

I don't have a lot of experience with any of them, but a quick Google search turned up

  • http://www.codeproject.com/kb/Ajax/JavaScriptSOAPClient.aspx
  • http://javascriptsoapclient.codeplex.com/
  • http://plugins.jquery.com/project/jqSOAPClient


来源:https://stackoverflow.com/questions/2886153/how-to-post-a-soap-request-from-a-browser

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!