Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Using the axis2.xml

...

file

WSO2 products come with a configuration file named axis2.xml . This XML configuration file can be found at <CARBONin <PRODUCT_HOME>/repository/conf/axis2 directory. This is similar to similar to the axis2.xml file that ships comes with " Apache Axis2 " and " Apache Synapse. " It contains the global configuration for WSO2 Carbon and the Carbon-based of WSO2 products. The axis2.xml configuration generally includes configuration details for modules, phases, handlers, global configuration parameters and transports. The elements elements <transportReceiver> and  and <transportSender> are  are used to configure transport listeners and senders respectively. In the axis2.xml file that comes with WSO2 Carbon or any Carbon-based productproducts, some transports are already configured and enabled by default, including the HTTP and HTTPS transports.The HTTP transport receiver configuration is something similar to the following as mentioned in the axis2

Info

Note: Although axis2.xml file contains configurations for HTTP/S transports by default, they are not used by WSO2 products. Instead, the products use the HTTP/S transport configurations in Tomcat-level. Therefore, changing the HTTP/S configurations in axis2.xml file has no effect.

Given below is an example JMS transport receiver configuration in the axis2.xml file. 

Code Block
languagehtml/xml
<transportReceiver name="

...

jms" class="org.

...

apache.

...

axis2.

...

transport.

...

jms.JMSListener">
        <parameter name="myTopicConnectionFactory">
     

...

       <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
           

...

 <parameter name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</parameter>
        </parameter>

        <parameter name="myQueueConnectionFactory">
            <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
            <parameter name="

...

java.naming.provider.url">tcp://localhost:61616</parameter>
           

...

 <parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
        </parameter>

        <parameter name="default">
            <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
            

...

<parameter name="

...

transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
        </parameter>
</transportReceiver>

...

<transportReceiver> element has the following attributes and sub elements:

  • name - A mandatory attribute which indicates a unique name for the transport receiver.
  • class - A mandatory attribute which indicates the transport receiver implementation class.
  • parameters - Configuration parameters for the transport receiver. It should be included as child elements of the the <transportReceiver> element.

In the above example, the parameter named "port" for the HTTP transport receiver was defined.

...

  •  element. 

Similarly use <transportSender> element to configure and enable transport senders in WSO2 Carbon. Given below is the HTTP transport sender configuration that comes with WSO2 Carbon by default along with other transports as mentioned in the axis2.xml file. It contains three parameters.

Code Block
languagehtml/xml
<transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
   
      <parameter name="PROTOCOL">HTTP/1.1</parameter>
      <parameter name="Transfer-Encoding">chunked</parameter>
      <parameter name="OmitSOAP12Action">true</parameter>
   
</transportSender>

...

titleNote

products. 

info
Info
  • The axis2.xml file
will be
  • is loaded to memory only during server startup. Therefore, you must restart the server to apply any changes
made
  • you make to the file while the server is up and running
will not be applied until the server is restarted
  • .
titleNote
  • Simply having <transportReceiver> and <transportSender> elements in the axis2.xml file causes those transports to be loaded and activated during server startup. Therefore, you must include any dependency JARs required by those transport implementations
must be included
  • in the server classpath to prevent the server from running into exceptions at startup. In addition to that, an inaccurate transport configuration (for example, a wrong parameter value) might cause the transport to be not enabled properly.

...


...

As an alternative to the traditional axis2.xml file-based configuration method, one might use the WSO2 Carbon Management Console to manage transport receivers and senders. Carbon Management Console loads transport configurations from the embedded registry and any changes made to the configurations through the UI will also be saved back into the registry.

When a transport is enabled from the management console, its configuration will be saved in the registry and loaded automatically during the next server startup. Transport configurations specified in axis2.xml get higher priority over configurations stored in the registry. Therefore if the same transport is enabled in axis2.xml as well as in the registry, transport configuration in axis2.xml will be loaded and activated. This method of configuration is mainly intended for relatively novice users. However, it is very useful even for advanced users because it enables one to try out different transport settings without having to restart the server many times.

Follow the instructions bellow to configure transports globally using the management console. You can configure only enabled transports.

1. Log on to the product's management console and select "Transports" to access "Transport Management."

Image Removed

2. The "Transport Management" page lists the available transport listeners and senders. From here, you can enable, disable and configure transport listeners and senders separately, without having to restart the server. Click on the "Configure" link of a certain transport listener/sender.

Image Removed

3. You will be taken to a page, where you can add and edit transport parameters. Do your configuration and click the "Update" button to save the changes. The updated settings will take effect immediately and the corresponding transport listener or sender will be restarted.

For example,

Image Removed

Adding Transport Parameters

1. Enter the parameter's name and click the "Add" button. For example,

Image Removed

2. Edit the parameter's value .

Image Removed

Editing Transport Parameters

You can edit the parameter's value right in the textarea.

Image Removed

Enabling and Disabling Transports

The "Transport Management" page lists the available transport listeners and senders. From there, you can enable or disable transports.

Enabling Transports AnchorEnabling TransportsEnabling Transports  

Follow the instructions below to enable transports.

1. Click on the "Enable" link of a certain transport listener/sender in the "Transport Management" page.

Image Removed

2. You will be taken to a page where you can specify configuration parameters for the transport listener or the sender you want to enable. You will notice that all the required fields are already populated with a set of default values. Change the default values to suit the requirements of your deployment and click "Enable" to enable the transport listener/sender.

Image Removed

Info
titleNote

If any of the dependencies required to enable the transport listener or the sender are missing, the transport will not be enabled and you will be redirected back to the "Transport Management" page. You will notice that the "Enable" option is still available for that particular transport listener or sender, indicating that it has not been enabled. Therefore it is important that you put all the required JARs in the PRODUCT_HOME/repository/components/dropins directory before attempting to activate a transport listener or a sender.

Disabling Transports AnchorDisabling TransportsDisabling Transports  

Follow the instructions below to disable transports.

Info
titleNote

HTTP and HTTPS transports are configured in the axis2.xml. They are always loaded from the axis2.xml at the server startup. Also HTTP and HTTPS transports cannot be disabled since those transports are required by the Carbon management console and related administrative services. In case of HTTP/HTTPS transport listeners and senders, you will receive a warning dialog indicating that those transports cannot be disabled.

1. Click on the "Disable" link of a certain transport listener/sender in the "Transport Management" page.

Image Removed

2. Confirm your request to disable transport listener/sender by clicking "Yes."

Image Removed

Excerpt
hiddentrue
Instructions to configure transports globally in WSO2 products

Using catalina-server.xml file

In addition to the above, transport receivers can be configured globally using the <PRODUCT_HOME>/repository/conf/tomcat/catalina-server.xml file. The default HTTP/S configuration specified in the catalina-server.xml file is given below:

Code Block
languagehtml/xml
titleDefault HTTP/S Config in catalina-server.xml
<!--  optional attributes:
    proxyPort="80"-->

<Connector  protocol="org.apache.coyote.http11.Http11NioProtocol"
            port="9763"
            bindOnInit="false"
            maxHttpHeaderSize="8192"
            acceptorThreadCount="2"
            maxThreads="250"
            minSpareThreads="50"
            disableUploadTimeout="false"
            connectionUploadTimeout="120000"
            maxKeepAliveRequests="200"
            acceptCount="200"
            server="WSO2 Carbon Server"
            compression="on"
            compressionMinSize="2048"
            noCompressionUserAgents="gozilla, traviata"
            compressableMimeType="text/html,text/javascript,application/x-javascript,application/javascript,application/xml,text/css,application/xslt+xml,text/xsl,image/gif,image/jpg,image/jpeg" URIEncoding="UTF-8"/>
   
<!--  optional attributes:proxyPort="443"-->

<Connector  protocol="org.apache.coyote.http11.Http11NioProtocol"
            port="9443"
            bindOnInit="false"
            sslProtocol="TLS"
            maxHttpHeaderSize="8192"
            acceptorThreadCount="2"
            maxThreads="250"
            minSpareThreads="50"
            disableUploadTimeout="false"
            enableLookups="false"
            connectionUploadTimeout="120000"
            maxKeepAliveRequests="200"
            acceptCount="200"
            server="WSO2 Carbon Server"
            clientAuth="false"
            compression="on"
            scheme="https"
            secure="true"
            SSLEnabled="true"
            compressionMinSize="2048"
            noCompressionUserAgents="gozilla, traviata"
            compressableMimeType="text/html,text/javascript,application/x-javascript,application/javascript,application/xml,text/css,application/xslt+xml,text/xsl,image/gif,image/jpg,image/jpeg"
            keystoreFile="${carbon.home}/repository/resources/security/wso2carbon.jks"
            keystorePass="wso2carbon" 
            URIEncoding="UTF-8"/>

At the moment, you can configure only the default servlet transports of WSO2 using catalina-server.xml file.

Info

For more details on config parameters, see http://tomcat.apache.org/tomcat-7.0-doc/config/http.html.