There are some methods to configure and enable transports enable Transports in WSO2 Carbon or any Carbon based solution.
- #Using Using the axis2.xml file
- #Using Using the WSO2 Carbon Management Console
- #Configuring Configuring Servlet Transports in the Standalone Mode Using the transportsthe catalina-server.xml File
- #Configuring Configuring Transports at Service Level
...
WSO2 Carbon and all Carbon based products ship with a configuration file named axis2.xml.
This XML configuration file can be found at $CARBON<PRODUCT_HOMEHOME>/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 receivers 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 would be something similar to the following.
Code Block |
---|
<transportReceiver name="http" class="org.wso2.carbon.core.transports.http.HttpTransportListener">
<parameter name="port">9763</parameter>
</transportReceiver>
|
...
Similarly <transportSender
> elements can be used to configure and enable transport senders in WSO2 Carbon. Given below is the HTTP transport sender configuration that comes with WSO2 Carbon by default. It contains three parameters.
Code Block |
---|
<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>
|
...
Anchor | ||||
---|---|---|---|---|
|
Configuring Servlet Transports in the Standalone Mode Using
...
the catalina-server.xml File
In addition to the two methods discussed above, there is a third method to globally configure transport receivers in Carbon which works only when Carbon is running in the standalone mode (in other words, no external servelet container is being used to deploy Carbon). By default, WSO2 Carbon and all Carbon based products run in the standalone mode and hence it is important that users be aware of this configuration method.
When Carbon is running in the standalone mode one could use the $CARBON<PRODUCT_HOMEHOME>/repository/conf/transportstomcat/catalina-server.xml file to specify transport receiver configurations. By default, you will find the HTTP and HTTPS servlet transports configured in this file. The XML syntax to configure transports in the transportscatalina-server.xml file is similar to the syntax used in the axis2.xml
file, with only difference being the <transport
> element taking the place of the <transportReceiver
> element. The default HTTP receiver configuration specified in the transportsthe catalina-server.xml file is given below.
Code Block |
---|
<transport name="http" class="org.wso2.carbon.server.transports.http.HttpTransport">
<parameter name="port">9763</parameter>
<parameter name="maxHttpHeaderSize">8192</parameter>
<parameter name="maxThreads">150</parameter>
<parameter name="minSpareThreads">25</parameter>
<parameter name="maxSpareThreads">75</parameter>
<parameter name="enableLookups">false</parameter>
<parameter name="disableUploadTimeout">false</parameter>
<parameter name="clientAuth">false</parameter>
<parameter name="maxKeepAliveRequests">100</parameter>
<parameter name="acceptCount">100</parameter>
<parameter name="compression">force</parameter>
<parameter name="compressionMinSize">2048</parameter>
<parameter name="noCompressionUserAgents">gozilla, traviata</parameter>
<parameter name="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
</parameter>
</transport>
|
However, there is a fundamental difference between transports configured in axis2.xml
and transports configured in transportscatalina-server.xml.
Transport receivers configured in transportscatalina-server.xml
will be loaded through a special "Transport Manager" implementation in Carbon. Therefore the classes specified in the <transport
> element must implement the interface org.wso2.carbon.server.transports.Transport
. Currently only the default servlet transports of Carbon can be configured from the transportsfrom catalina-server.xml file.
Configuring Transports at Service Level
Anchor | ||||
---|---|---|---|---|
|
...
Service level transport configuration is performed by editing the service.xml
file associated with each service. When dealing with Proxy Services (for example in WSO2 ESB) using the Carbon's proxyadmin component, service level transport parameters should be specified in the Proxy Service configuration by using the provided Proxy Service management tools in the Carbon management console. See more information about Proxy Services in Service Mediation.
Excerpt | ||
---|---|---|
| ||
Instructions on how to configure and enable transports in WSO2 ESB. |