InfoCenter Home >
4: Developing applications >
4.8: Web services - an overview >
4.8.2: Apache SOAP deployment descriptors >
4.8.2.1: SOAP deployment descriptors in WebSphere Application Server

4.8.2.1: SOAP deployment descriptors in WebSphere Application Server

This article describes the different types of deployment descriptors that can be used in WebSphere Application Server. Deployment descriptors for each of the soap samples are included in the soapsamples.ear file in the ServerSamplesCode directory (for example,
<product_installation>/installedApps/soapsamples.ear/ServerSampleCode/src/addressbook/DeploymentDescriptor)

Standard Java class deployment descriptor

A deployment descriptor which exposes a service that is implemented with a standard Java class (including a normal java bean) looks like this example:

<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 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.)
  • 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.

On the <service> element, there is an optional attribute called type which is set to the value "message" if the service is document-oriented instead of RPC-invoked.

On the <java> element, there is an optional attribute called static, 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.

On the <provider> element, there is a scope attribute 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 that is servicing the requests, is terminated.

EJB deployment descriptor

A deployment descriptor that exposes a service which is implemented with an Enterprise Java Bean looks like this next example:

<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>

  The default values for the iiop URL and context provider keys are:
<isd:option key="ContextProviderURL" value="iiop://localhost:900" />
<isd:option key="FullContextFactoryName" value="com.ibm.websphere.naming.WsnInitialContextFactory" />
To use your own values, you must specify:
<isd:option key="ContextProviderURL" value="<URL to the JNDI provider>" />
<isd:option key="FullContextFactoryName" value="<Context factory full class name>" />

A description of the keys and variables follows:

  • service-urn and exposed-methods have the same meaning as in the standard Java class deployment descriptor
  • provider-class is one of the following depending on the implementation of the bean:
    Provider class Bean implementation
    com.ibm.soap.providers.WASStatelessEJBProvider stateless session bean
    com.ibm.soap.providers.WASStatefulEJBProvider stateful session bean
    com.ibm.soap.providers.WASEntityEJBProvider entity bean

  • jndi-name is the registered JNDI name of the EJB
  • home-name is the fully qualified class name of the EJB's home.

Bean Scripting Framework (BSF) script deployment descriptor

A deployment descriptor that exposes a service which is implemented with a BSF script looks like the following example:

<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.

The deployment descriptor must also have a source attribute on the <script> element, or a script-body attribute. The script-body attribute contains the actual script that is used to provide the service. If the deployment descriptor has the source attribute, then source-filename refers to the file which contains the service implementation.

DB2 stored procedure deployment descriptor

A deployment descriptor which exposes one or more DB2 stored procedures as a services looks like the following example:

<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. See article DB2 Stored procedure sample setup for more information.
  • 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 datasource 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.

See the related topics section for links to an enablement scenario.

Go to previous article: Apache SOAP deployment descriptors Go to next article: Quick reference of Web services resources

 

 
Go to previous article: Apache SOAP deployment descriptors Go to next article: Quick reference of Web services resources