Apache SOAP deployment descriptor

 

Apache SOAP utilizes XML documents called deployment descriptors to provide the SOAP run-time with information on client services.

Deployment descriptors provide a variety of information including:

  • Service Uniform Resource Name (URN) used to route the request when it arrives
  • Method and class details, if the service is being provided by a Java class
  • User ID and password information, if the service provider must connect to a database

There are four types of deployment descriptors that you can be use in WebSphere Application Server.

  • Standard Java class
  • Enterprise bean
  • BSF
  • DB2 stored

The contents of the deployment descriptor depend on the type of artifact that is being exposed using SOAP. Samples of these deployment descriptors are available in the SOAP 2.3 sample. One can link to the sample from the article Web services: Resources for Learning.

 

Standard Java class deployment descriptor

A deployment descriptor that exposes a service implemented with a standard Java class, including a normal Java bean. An example of the standard Java class deployment descriptor follows:

<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
             id="urn:service-urn" [type="message"]>
             <isd:provider type="java" 
             scope="Request | Session | Application"
             methods="exposed-methods">
             <isd:java class="implementing-class" [static="true|false"]/>
             </isd:provider>
  <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>
             </isd:service>

where:

  • service-urn is the uniform resource name (URN) given to a service. All services deployed within a single EAR file must have URNs that are unique within that EAR file.

  • exposed-methods is a list of methods, separated by spaces, which are being exposed.

  • implementing-class is a fully-qualified class name (that is, a packagename.classname) that provides the methods that are being exposed.

  • type is an optional attribute on the service <element>. Type is set to the value "message" if the service is document-oriented instead of RPC-invoked.

  • static is an optional attribute called on the java> element, which may be set to either "true" or "false", depending on whether the methods are exposed or not exposed. If exposed, this attribute indicates whether the method is static or not static.

  • scope is an attribute on the <provider> element, which indicates the lifetime of the instantiation of the implementing class.

  • "Request" indicates the object is removed after the request completes.
  • "Session" indicates the object lasts for the current lifetime of the HTTP session.
  • "Application" indicates the object lasts until the servlet, which is servicing the requests, is terminated.

 

EJB deployment descriptor

A deployment descriptor that exposes a service implemented with an Enterprise Java Bean. An example of an EJB deployment descriptor is as follows:

<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
             id="urn:service-urn">
             <isd:provider type="provider-class"
             scope="Application"
             methods="exposed-methods">
             <isd:option key="JNDIName" value="jndi-name"/>
             <isd:option key="FullHomeInterfaceName" value="home-name" />
             </isd:provider>
                <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>
             </isd:service>

where:

  • service-urn and exposed-methods have the same meaning as in the standard Java class deployment descriptor

  • provider-class with a stateless session bean follows:

    com.ibm.soap.providers.WASStatelessEJBProvider
    

  • jndi-name is the registered JNDI name of the enterprise bean

  • home-name is the fully-qualified class name of the enterprise bean's home.

The default values for the iiop URL and context provider keys are:

<isd:option key="ContextProviderURL" value="iiop://localhost:2809" />
<isd:option key="FullContextFactoryName" value="com.ibm.websphere.naming.WsnInitialContextFactory" />
To use

your own values, specify:

<isd:option key="ContextProviderURL" value="<URL to the JNDI provider>" />
<isd:option key="FullContextFactoryName" value="<Context factory full class name>" />

BSF script deployment descriptor

A deployment descriptor that exposes a service implemented with a BSF script. An example follows:

<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
             id="urn:service-urn">
             <isd:provider type="script"
             scope="Request | Session | Application"
             methods="exposed-methods">
             <isd:script language="language-name" [source="source-filename"]>[script-body]
             </isd:script>
             </isd:provider>
             <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>
             </isd:service>

where:

  • service-urn, exposed-methods, and scope have the same meaning as in the standard Java class deployment descriptor.

  • language-name is the name of the BSF-supported language that is used to write the script.

  • source or script-body is an attribute that is mandatory for the <script> element. The script-body attribute contains the actual script that is used to provide the service.

  • source-filename refers to the file which contains the service implementation if the deployment descriptor has the source attribute.

DB2 stored procedure deployment descriptor

A deployment descriptor that exposes one or more DB2 stored procedures as a service. An example follows:

<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
            id="urn:service-urn">
            <isd:provider type="com.ibm.soap.providers.WASDB2SPProvider"
            scope="Application"
            methods="* | exposed-methods">
            <isd:option key="userID" value="db-userid"/>
            <isd:option key="password" value="db-password"/>
            [<isd:option key="fullContextFactoryName" value="context-factory"/>
            <isd:option key="datasourceJNDI" value="jndi-name"/>] 
            [<isd:option key="dbDriver" value="db-driver"/>
            <isd:option key="dbURL" value="db-url"/>]
            </isd:provider>
            <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>
            </isd:service>

where:

  • service-urn and exposed-methods have the same meaning as in the standard Java class deployment descriptor.

  • db-userid is a valid user ID used to access the database where the stored procedures reside.

  • db-password is a valid password for the specified user ID

    The db-userid and db-password entries are optional. These entries can be set in the datasource. In WebSphere Application Server, the preferred way for administering the db-userid and db-password entries is with a datasource. Changing the user ID and password is easier when the information is located in a datasource rather than in a separate deployment descriptor file.

  • context-factory is the name of the context factory used to access the database

  • jndi-name is the datasource used to access the database

  • db-driver is the database driver used to access the database.

    A db-driver is not required if a data source JNDI name is specified.

  • db-url is the URL that specifies the database to access.

The methods attribute on the <provider> element can contain a list of space-separated procedure names to expose, or an * (asterisk). An asterisk indicates all available stored procedures should be exposed.


Web services: Links

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.