Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to post a SOAP request from a browser?

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.

like image 535
understack Avatar asked May 21 '10 23:05

understack


People also ask

How do I send a SOAP request in HTML?

To make SOAP requests to the SOAP API endpoint, use the "Content-Type: application/soap+xml" request header, which tells the server that the request body contains a SOAP envelope. The server informs the client that it has returned a SOAP envelope with a "Content-Type: application/soap+xml" response header.


1 Answers

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
like image 190
tschaible Avatar answered Oct 13 '22 20:10

tschaible