ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzamy_5.4.0.1/50/webserv/wssoapexam.htm

77 lines
3.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<LINK rel="stylesheet" type="text/css" href="../../../rzahg/ic.css">
<title>Soap examples</title>
</head>
<BODY>
<!-- Java sync-link -->
<SCRIPT LANGUAGE="Javascript" SRC="../../../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
<h5><A NAME="wssoapexam">Soap examples</A></h5>
<p><strong>SOAP request example</strong></p>
<p>The SOAP request that follows indicates that the OrderItem() method, from the Some-URI namespace, should be invoked from http://www.somesupplier.com/Supplier. Upon receiving this request, the supplier application at www.somesupplier.com runs the business logic that corresponds to OrderItem.</p>
<p><strong>Note:</strong> For legal information about this code example, see the <a href="../program/codex.htm" target="_">Code example disclaimer</a>.</p>
<pre>
Sample SOAP Request
POST /Supplier HTTP/1.1
Host: www.somesupplier.com
Content-Type: text/xml; charset=&quot;utf-8&quot;
Content-Length: nnnn
SOAPAction: &quot;Some-URI&quot;
&lt;SOAP-ENV:Envelope
xmlns:SOAP-ENV=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
SOAP-ENV:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;&gt;
&lt;SOAP-ENV:Body&gt;
&lt;m:OrderItem xmlns:m=&quot;Some-URI&quot;&gt;
&lt;RetailerID&gt;557010&lt;/RetailerID&gt;
&lt;ItemNumber&gt;1050420459&lt;/ItemNumber&gt;
&lt;ItemName&gt;AMF Night Hawk Pearl M2&lt;/ItemName&gt;
&lt;ItemDesc&gt;Bowling Ball&lt;/ItemDesc&gt;
&lt;OrderQuantity&gt;100&lt;/OrderQuantity&gt;
&lt;WholesalePrice&gt;130.95&lt;/WholeSalePrice&gt;
&lt;OrderDateTime&gt;2000-06-19 10:09:56&lt;/OrderDateTime&gt;
&lt;/m:OrderItem&gt;
&lt;/SOAP-ENV:Body&gt;
&lt;/SOAP-ENV:Envelope&gt;
</pre>
<p>The SOAP protocol does not specify how to process the order. The supplier could run a CGI script, invoke a servlet, or perform any other process that generates the response.</p>
<p><strong>SOAP response example</strong></p>
<p>The response to a SOAP Request is an XML document that contains the results of the processing. In this example, this is the order number for the order placed by the retailer.</p>
<p><strong>Note:</strong> For legal information about this code example, see the <a href="codex.htm" target="_">Code example disclaimer</a>.</p>
<pre>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=&quot;utf-8&quot;
Content-Length: nnnn
&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
SOAP-ENV:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;/&gt;
&lt;SOAP-ENV:Body&gt;
&lt;m:OrderItemResponse xmlns:m=&quot;Some-URI&quot;&gt;
&lt;OrderNumber&gt;561381&lt;/OrderNumber&gt;
&lt;/m:OrderItemResponse&gt;
&lt;/SOAP-ENV:Body&gt;
&lt;/SOAP-ENV:Envelope&gt;
</pre>
<p>The response does not include a SOAP-specified header. The results are placed in an element whose name matches the method name (OrderItem) with the suffix (Response), such as <tt>OrderItemResponse</tt>.</p>
</body>
</html>