Versions Compared

Key

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

...

WSO2 Carbon and all Carbon-based products are shipped with a configuration file named axis2.xml. This XML configuration file can be found at <CARBON_HOME>/ repository/conf/axis2 directory. This is similar to the axis2.xml file that ships with Apache Axis2 and Apache Synapse. It contains the global configuration for WSO2 Carbon and the Carbon-based products. The axis2.xml configuration generally includes configuration details for modules, phases, handlers, global configuration parameters and transports. The elements <transportReceiver> and <transportSender> are used to configure transport listeners and senders respectively. In the axis2.xml file that comes with WSO2 Carbon or any Carbon-based product, 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.xml file:

Configuring http/s via the axis2.xml file does not have any affect.
Info
Info

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="httpjms" class="org.wso2apache.carbonaxis2.coretransport.transports.http.HttpTransportListenerjms.JMSListener">
        <parameter name="myTopicConnectionFactory">
     <!-- Uncomment the following if you are deploying this within an application server.       <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
             You need to specify the HTTP port of the application server --><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="port">9763</parameter>java.naming.provider.url">tcp://localhost:61616</parameter>
            <parameter <!-- Uncomment the following to enable Apache2 mod_proxy. The port on the Apache server is 80 in this case. -->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="proxyPort">80</parameter>-->transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
        </parameter>
</transportReceiver>

<transportResiever> <transportReciever> attributes and elements:

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

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

...

  •  
Similarly use <transportSender> element to configure and enable transport senders in WSO2

...

languagehtml/xml

...

products. 
Info
  • The axis2.xml file will be loaded to memory only during server startup. Therefore, any changes made to the file while the server is up and running will not be applied until the server is restarted.
  • Simply having <transportReceiver> and <transportSender> elements in the axis2.xml file causes those transports to be loaded and activated during server startup. Therefore, 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, an inaccurate transport configuration (for example, a wrong parameter value) might result in the transport not being enabled properly.

...

Code Block
title
languagehtml/xmlDefault 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"/>

Currently only the default servlet transports of Carbon can be configured using the catalina-server.xmlxml file.

Info

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