Java Reference
In-Depth Information
figure 10-9  
6.
Finally, the web service also provides an example of a SOAP request‐reply interchange to access
this web service. Let's take a look at the example request:
POST /stockquote.asmx HTTP/1.1
Host: www.webservicex.net
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: " http://www.webserviceX.NET/GetQuote"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd=" http://www.w3.org/2001/XMLSchema"
xmlns:soap=" http://schemas.xmlsoap.org/soap/envelope/" >
<soap:Body>
<GetQuote xmlns=" http://www.webserviceX.NET/">
<symbol>string</symbol>
</GetQuote>
</soap:Body>
</soap:Envelope>
This request message tells you a few things. First, you now know that you should make
a request to the URL /stockquote.asmx at the host www.webservicex.net . Next, you
should also provide a SOAPAction header with the content http://www.webserviceX.NET/
GetQuote . Finally, the XML encoded SOAP message itself contains the GetQuote operation
call with a symbol tag to pass the argument.
If all goes well, the server replies with the following:
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
Search WWH ::




Custom Search