Version 8.0 SP4
 —  Configuration  —

Web Services Stack Runtime

The information is organized under the following headings:


Understanding axis2.xml Configuration

Following are the top-level elements that can be seen in the axis2.xml configuration file:

  1. Parameters
    In Axis 2, a parameter is a name value pair. Each top level parameter available in the axis2.xml file (direct sub-elements of a root element) is transformed into properties in AxisConfiguration. Therefore, if you want to access the top level parameters in the configuration document, you must use the AxisConfiguration in the running system.

    Following is the correct way of defining a parameter:

    <parameter name="name of the parameter" >parameter value </parameter>
  2. Transport Receivers
    You must use a corresponding transport receiver for every other transport that Axis 2 runs on. Following is an example of how you can add and define transport receivers in the axis2.xml file:

    <transportReceiver name="http" class="org.apache.axis2.transport.http.SimpleHTTPServer">
            <parameter name="port" >6060</parameter>
     </transportReceiver> 
    

    The attribute name of the transportReceiver property is the name of the transport itself. It can be HTTP, TCP, SMTP, etc. As soon as the system starts up, or when you set the transport at the client side, you actually load the transport that you have specified. The class attribute defines the actual Java class that implements the interfaces required for the transport. Transports can have zero parameters, but they can also have one or more than one. Nevertheless, the corresponding transport receiver gives access to the parameters.

  3. Transport Senders
    You can register transport senders in the system in the same way as transport receivers. Later, at run time, those senders can be used to send messages. As an example, consider Axis 2 running under Tomcat. In this case, Axis can use TCP rather HTTP transport senders to send messages. Following is the way to specify transport senders:

    <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
            <parameter name="PROTOCOL" locked="xsd:false">HTTP/1.0</parameter>
     </transportSender> 
    

    In the preceding example, the attribute name is the name of the transport. The attribute class is the implementation class of the corresponding transport. Transport senders can have zero or more than one parameters in the same way as transport receivers. If there are any parameters specified, then you can access them at run time through the corresponding transport.

  4. Phase Orders
    The specifying order of phases in the execution chain has to be done using a phase order element. Following is an example of such an element:

    <phaseOrder type="inflow">
             <phase name="TransportIn"/>
             .
             .
    </phaseOrder>   
    

    If you want to add a handler that must go into that phase, you can do that by adding directly a handler element into it. In addition, configurations for handler chains in Axis 2 are also done in the phase order element.

    Following is an example of the complete configuration of the order of phases in the execution chain with specified corresponding handlers:

    <phaseOrder type="InFlow">
    <!-- System pre-defined phases -->
    <phase name="Transport">
    <handler name="RequestURIBasedDispatcher"
    class="org.apache.axis2.engine.RequestURIBasedDispatcher">
    <order phase="Transport"/>
    </handler>
    <handler name="SOAPActionBasedDispatcher"
    class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
    <order phase="Transport"/>
    </handler>
    </phase>
    <phase name="Security"/>
    <phase name="PreDispatch"/>
    <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
    <handler name="RequestURIBasedDispatcher"
    class="org.apache.axis2.engine.RequestURIBasedDispatcher"/>
    <handler name="SOAPActionBasedDispatcher"
    class="org.apache.axis2.engine.SOAPActionBasedDispatcher"/>
    <handler name="AddressingBasedDispatcher"
    class="org.apache.axis2.engine.AddressingBasedDispatcher"/>
    <handler name="RequestURIOperationDispatcher"
    class="org.apache.axis2.engine.RequestURIOperationDispatcher"/>
    <handler name="SOAPMessageBodyBasedDispatcher"
    class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher"/>
    <handler name="HTTPLocationBasedDispatcher"
    class="org.apache.axis2.engine.HTTPLocationBasedDispatcher"/>
    </phase>
    <!-- System pre-defined phases -->
    <!-- After Postdispatch phase module author or service
    author can add any phase he or she wants -->
    <phase name="MyOwnPhase"/>
    <phase name="soapmonitorPhase"/>
    </phaseOrder>
    

    The attribute type represents the type of message flow and can be only one of the following kinds:

    The following diagram shows a sample message flow with default phases:

    graphics/message_flow.png

    In addition to the <handler> child element allowed inside the phaseOrder, the other possible element is the <phase> element. It represents available phases in the execution chain. Following is the right way to specify phases inside phaseOrder:

    <phase name="Transport"/>

    In this example, name is the name of the phase.

    There are two types of phases: pre-defined ones (required by Axis 2) and user-defined ones. In addition to the pre-defined phases, a user can add user-defined phases to the flows in the configuration file. For the in-flow, user-defined phases can be added only after the PostDispatch pre-defined phase. This is because the Axis 2 engine keeps the flow related information attached to the operations, and it is only after the Dispatch phase that the operation is found. There are no rules restricting the placement of user-defined phases in the out-flow. If any of the user-defined phases has the same name as that of a pre-defined phase, the engine fails to operate.

    Web Services Stack 8.0 uses Axis 2 1.4 with the following definition of the default pre-defined system phases for the In-Flows:

    Add your own phases after the system ones in In-Flows.

    Web Services Stack 8.0 uses Axis 2 1.4 with the following definition of default pre-defined system phases for the Out-Flows:

    Add your own phases before the system ones in Out-Flows.

    Important:
    Do not change the order of the system pre-defined phases in all four kinds of flows. If you want to add a new phase, you can do that after the system pre-defined phase, as is done in the default axis2.xml file.

  5. Module References
    If you want to engage a module system-wide, you can do so by adding a top-level module element in the axis2.xml file. Following is an example of how to do it:

    <module ref="addressing"/>

    The parameter ref in the preceding example is the module name that is going to be engaged system-wide.

  6. Listeners (Observers)
    In Axis 2, AxisConfiguration is observable, so that one can register observers into that, and they are automatically informed whenever a change occurs in AxisConfiguration. The observers are informed of the following events:

    Registering observers is very useful for additional features (such as RSS feed generation). Those observers provide service information to subscribers. The correct way of registering observers is the following:

    <listener class="org.apache.axis2.ObserverIMPL">
        <parameter name="RSS_URL" >http://127.0.0.1/rss</parameter>
      </listener>
    

    The parameter class represents an observer implementation class. The implementation class must implement AxisObserver interface, and the class has to be available in the classpath.

  7. Message Formatters
    The Web Services Stack axis2.xml file has defined new mesage formatters for the following content types to extend the default functionality provided by Axis2:

    The new definitions are as follows:

    <messageFormatter contentType="text/xml"
    			class="com.softwareag.formatters.RawXMLFormatter" />  
    <messageFormatter contentType="application/xml"
    			class="com.softwareag.formatters.RawXMLFormatter" />  
    <messageFormatter contentType="application/soap+xml"
    			class="com.softwareag.formatters.RawXMLApplicationXMLFormatter"/>
    
  8. Message builders
    The Web Services Stack axis2.xml file has defined new mesage builders for the following content types to extend the default functionality provided by Axis2:

    The new definitions are as follows:

    <messageBuilder contentType="text/xml"
    			class="com.softwareag.builders.RawXMLMessageBuilder"/>
    <messageBuilder contentType="application/soap+xml"
    			class="com.softwareag.builders.RawXMLMessageBuilder"/>
    <messageBuilder contentType="application/xml"
    			class="com.softwareag.builders.RawXMLMessageBuilder"/>
    

    The preceding message builders extend the default functionality provided by Axis 2 and handle some specific scenarios.

Note:
See the axis2.xml file for additional information about the possible settings and their values. The file also contains additional comments and samples.

Top of page

Run-Time Configuration

This section provides information on the configuration of global runtime through the axis2.xml file.

In Axis 2, there are three kinds of configuration files for configuring the system - the axis2.xml, the services.xml, and the module.xml:

There are some additional Web Services Stack-specific configuration files:

  1. SMH Agents Configuration Files:

    For information on the deployclient.properties file and the argusagent.properties file, see the overview of The Administration Tool

  2. Client-side Configuration Files:

Following are details on the axis2.xml configuration and on the proper way of adding and registering elements in axis2.xml:

In Axis 2, there are two kinds of axis2.xml configuration files - one for the configuration of the web service (server-side config file) and another one for configuration of the client of the web service (client-side config file).

Following is a screenshot of the locations of the occurrences of the axis2.xml file.

Note:
The installation folders of Web Services Stack are under \SoftwareAG\<Web Services Stack> folder.

graphics/config_file.png

The first location is in the conf folder of the Web Services Stack tree. This is the file that is used for configuring a stand-alone server (server-side configuration).

The second location is the conf folder of the <Web Services Stack> folder\repository folder. This is the file for configurations of the client side of web services (client-side configuration).

The third location is the conf folder of the \<Web Services Stack> folder\webapp\META-INF folder. This is the file for configurations of the server side of web services (server-side configuration).

Top of page

Server-side Configurations

Following are details on the HTTPS Deployment configurations performed at server side. These are the configurations for secured access to the Admin and Deploy Servlets.

If you run the Web Services Stack runtime under both HTTP and HTTPS you may also want to disable unsecured HTTP access to the Admin and Deploy Servlets. This can be done by uncommenting the two security constraints in the WEB-INF/web.xml.

The functionality of the Deploy Servlet is used in the Eclipse plug-in. For details, see Deploying and Undeploying a Web Service Package.

For details on the Admin Servlet, see Admin Servlet.

Start of instruction setTo allow access over HTTPS only

Top of page

Client-side Configurations

There is only one Web Services Stack-specific configuration at client side.

Following are details on how to take advantage of WS-Security by giving a value to the parameter securityConfigFile:

<parameter name="securityConfigFile">wsclientsec.properties</parameter>

The value of the parameter in the preceding example is the relative (or absolute) path to the properties file that contains security-related information.

This file must be part of the client’s CLASSPATH.

For more information about the configuration of wsclientsec.properties file, see the heading "Client-side Configuration" from Message-Level Security.

Top of page

MTOM in Web Services Stack

Apache Axis 2 supports Base64 encoding, SOAP with Attachments & MTOM (SOAP Message Transmission Optimization Mechanism).

MTOM is a W3C specification that focuses on solving the "Attachments" problem.

Binary content often has to be re-encoded to be sent as text data with SOAP messages. MTOM allows you to selectively encode portions of the message. In that case, you can send base64 encoded data as well as externally attached raw binary data.

For details of MTOM, see the specification at http://www.w3.org/TR/2004/PR-soap12-mtom-20041116/.

Following are some useful configurations that you need to get use of MTOM in Web Services Stack.

The parameter <parameter name="enableMTOM">…</parameter> can be set at all permitted levels (global level in axis2.xml, service level in services.xml, operation level in services.xml, etc.). It is up to the user to decide where to apply MTOM and to set that parameter in axis2.xml or service.xml).

<parameter name="enableMTOM">…</parameter> can have three different values:

Top of page