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

87 lines
4.6 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>Apache SOAP deployment descriptors</title>
</head>
<BODY>
<!-- Java sync-link -->
<SCRIPT LANGUAGE="Javascript" SRC="../../../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
<h5><A NAME="wsapacdd">Apache SOAP deployment descriptors</A></h5>
<p>Apache SOAP utilizes XML documents called deployment descriptors to provide the SOAP run time with information on client services. The contents of the deployment descriptor vary, depending on the type of programming component that is published using SOAP. Deployment descriptors provide an array of information, such as:</p>
<ul>
<li>The Web service's Uniform Resource Name (URN), which is used to route the request when it arrives</li>
<li>Method and class details, if the service is being provided by a Java<sup>(TM)</sup> class</li>
<li>User ID and password information, if the service provider must connect to a database</li>
</ul>
<p><strong>Standard Java class deployment descriptor</strong></p>
<p>A deployment descriptor that publishes a service that is implemented with a standard Java class or bean can look like this example:</p>
<pre>
&lt;isd:service xmlns:isd=&quot;http://xml.apache.org/xml-soap/deployment&quot; id=&quot;urn:<em>service-urn</em>&quot; [type=&quot;message&quot;]&gt;
&lt;isd:provider type=&quot;java&quot; scope=&quot;Request | Session | Application&quot; methods=&quot;<em>exposed-methods</em>&quot;>
&lt;isd:java class=&quot;<em>implementing-class</em>&quot; [static&quot;true|false&quot;]/&gt;
&lt;/isd:provider&gt;
&lt;isd:faultListener&gt;org.apache.soap.server.DOMFaultListener&lt;/isd:faultListener&gt;
&lt;/isd:service&gt;
</pre>
<p>In the example,</p>
<ul>
<li>Variables:
<ul>
<li><em>service-urn</em> is the URN that you give to a service. (All services deployed within a single EAR file must have URNs that are unique within that EAR file.)</li>
<li><em>exposed-methods</em> is a list of methods, separated by spaces, which are being published.</li>
<li><em>implementing-class</em> is a fully qualified class name (that is, a packagename.classname) that provides the methods that you are publishing.</li>
</ul>
</li>
<li>The &lt;service&gt; element has an optional attribute called type which is set to the value <tt>message</tt> if the service is document oriented instead of invoked with a remote procedure call (RPC).</li>
<li>The &lt;java&gt; element has an optional attribute called static, which can be set to either true or false, depending on whether the methods are available, or <strong>exposed</strong>, to service requesters. If exposed, this attribute indicates whether the method is static or not.</li>
<li>The &lt;provider&gt; element a scope attribute that indicates the lifetime of the instantiation of the implementing class.
<ul>
<li><strong>Request</strong> indicates the object is removed after the request completes.</li>
<li><strong>Session</strong> indicates the object lasts for the lifetime of the HTTP session.</li>
<li><strong>Application</strong> indicates the object lasts until the servlet that is servicing the requests is terminated.</li>
</ul>
</ul>
<p><strong>Bean Scripting Framework (BSF) script deployment descriptor</strong></p>
<p>A deployment descriptor that publishes a service that is implemented with a BSF script can look like the following example:</p>
<pre>
&lt;isd:service xmlns:isd=&quot;http://xml.apache.org/xml-soap/deployment&quot; id=&quot;urn:service-urn&quot;&gt;
&lt;isd:provider type=&quot;script&quot; scope=&quot;Request | Session | Application&quot; methods=&quot;exposed-methods&quot;&gt;
&lt;isd:script language=&quot;language-name&quot; [source=&quot;source-filename&quot;]&gt;[script-body]
&lt;/isd:script&gt;
&lt;/isd:provider&gt;
&lt;isd:faultListener&gt;org.apache.soap.server.DOMFaultListener&lt;/isd:faultListener&gt;
&lt;/isd:service&gt;</pre>
<p>where:</p>
<ul>
<li>service-urn, exposed-methods, and scope have the same meaning as in the standard Java class deployment descriptor.</li>
<li>language-name is the name of the BSF-supported language that you use to write the script.</li>
</ul>
<p>The deployment descriptor must also have a source attribute on the &lt;script&gt; element, or a script-body attribute. The script-body attribute contains the script that is used to provide the service. If the deployment descriptor has the source attribute, then source-filename refers to the file that contains the service implementation.</p>
</body>
</html>