Once you deploy Apache Axis2 Web application in a servlet container, all your services, by default, will get two endpoints to interact with the external world. One for SOAP interactions and the other for REST interactions. Sometimes you might want to customize this default behaviour to suit your specific requirements.
For example, you might want to completely disable REST support, or might want to enable both REST and SOAP to be handled in a single endpoint.
Let's see how this can be done using the following newly introduced parameters to Axis2 configuration file ($CONTEXT_ROOT/axis2/WEB-INF/conf/axis2.xml. CONTEXT_ROOT will be $TOMCAT_HOME/webapps in Apache Tomcat. If you are using a different servlet container, please refer its documentation to find out the context root of it).
- enableRESTInAxis2MainServlet - REST messages handling in the SOAP endpoint is disabled by default. But setting this flag you can enable REST handling in the main servlet. This flag helps one to have a single endpoint for both SOAP and REST messages, by enabling REST handling in the main servlet.
- disableSeparateEndpointForREST - There is a separate endpoint enabled for REST messages by default. Setting this flag to true will disable that endpoint.
- disableREST - REST handling is on, by default. Once this flag is set to true, this flag will disable REST handling in all the endpoints.
As mentioned above, tweaking the above three parameters helps you to control the REST handling capabilities of your Axis2 engine. For example, if you want to have one and only endpoint to handle all the messages, then you can set the parameters as follows in the axis2.xml
<parameter name="enableRESTInAxis2MainServlet" locked="true">true</parameter>
<parameter name="disableSeparateEndpointForREST" locked="true">true</parameter>
Applies To:
Apache Axis2/Java nightly builds and post 1.0 versions