Oracle Waveset 8.1.1 Web Services

Configuring web.xml

If you are using a servlet container such as Tomcat, you can use the web.xml file to set up the openspmlRouter servlet, which handles SPML 2.0 requests.


Note –

The web.xml file ships with a default installation, so no action is required.


The web.xml file contains an optional init-param parameter that you can use to open a monitor window (in Swing) that displays the flow of SPML 2.0 messages. You can use this window to monitor the flow of SPML 2.0 messages, which can be useful for debugging purposes.

The following example shows how to add the lisinit-param parameter.


Example 2–19 Adding the init-param Parameter


<init-param>
    <param-name>monitor</param-name>
    <param-value>org.openspml.v2.util.SwingRPCRouterMonitor</param-value>
</init-param>

The next example contains a commented section and includes information about other init-param parameters.


Example 2–20 Commented Example

<servlet>
    <servlet-name>openspmlRouter</servlet-name>
    <display-name>OpenSPML SOAP Router</display-name>
    <description>A router of RPC traffic - nominally SPML 2.0 over 
        SOAP</description>
    <servlet-class>
    org.openspml.v2.transport.RPCRouterServlet
    </servlet-class>
            
    <!--
        The Router uses dispatchers to process SOAP messages. 
        This is one that is in the toolkit that knows about SOAP.
        It has its own parameters, via naming convention. 
        See below.
    -->                
    <init-param>
        <param-name>dispatchers</param-name>
        <param-value>org.openspml.v2.transport.SPMLViaSoapDispatcher</param-value>
    </init-param>
            
    <!-- 
         Turn on trace to have the servlet write informational messages to the log.
    -->                
    <init-param>
        <param-name>trace</param-name>
        <param-value>false</param-value>
    </init-param>
            
    <!--
         The SpmlViaSOAPDispatcher  uses marshallers;
         there can be a chain, to move XML to SPML objects and back.    -->
    <init-param>
        <param-name>SpmlViaSoap.spmlMarshallers</param-name>
        <param-value>com.sun.idm.rpc.spml2.UberMarshaller</param-value>
    </init-param>
            
 <!--
         Our marshaller (UberMarshaller) has its own trace setting; 
         which doesn't really do anything in this release
    -->   
                
    <init-param>
        <param-name>SpmlViaSoap.spmlMarshallers.UberMarshaller.trace</param-name>
        <param-value>true</param-value>
    </init-param>
            
    <!--
      Finally, the dispatcher has a list of executors that actually implement the
      functionality. So, it sees a request, takes the SOAP envelope off, takes the 
      body from XML to OpenSPML Request classes, and then asks the list of 
      executors if they can process it. UberExecutor  will redispatch the request to 
      other executors.        Those are specified in spml2.xml (Configuration:SPML2).
    -->
                
    <init-param>
        <param-name>SpmlViaSoap.spmlExecutors</param-name>
        <param-value>com.sun.idm.rpc.spml2.UberExecutor</param-value>
    </init-param>
</servlet>