Integrate Axis2 within WmTomcat

Integrate Axis2 within WmTomcat

Software AG Web Services Stack is a toolkit that enables users to create, configure, deploy, and manage web services. WS-stack is built on AXIS2 platform and has its own context root “wsstack” binding with default port 10010. This practise is to integrated Axis2 in a Servlet Container which WmTomcat in this case.

Download Axis2 WAR (Web Archive) distribution

This is the Web application of Axis2, which can be deployed in most of the servlet containers. You can download the latest version of Axis2 WAR from:

Deploy Axis2 WAR in Tomcat

Hot deployment allows you to place a war file in a single directory and have WmTomcat unpack the web application files to the proper directory and update the application without having to manually reload the package.

1. Place your war file in the directory IntegrationServer/web/webapps.
2. Execute the wm.tomcat.admin:hotDeploy service. When this service executes, it checks the IntegrationServer/web/webapps directory.

Once hotDeploy service been executed, you can find new package axis has been created in IntegrationServer/packages. All components have been deployed in subfolder web.

Enable SOAP Monitor in Axis2

In Axis2 , SOAP Monitor utility is to provide a way for the developers to monitor these SOAP messages without requiring any special configuration or restarting the server. As SOAP requests and responses are received, the SOAP message information is forwarded to a SOAP monitor service where it can be displayed using a Web browser interface. The SOAP message information is accessed by a Web browser by going to http://localhost:5565/web/axis2/SOAPMonitor.

1. Enable SOAP Monitor by inserting the following in axis2.xml file. Axis2.xml file is located at IntegrationServer/packages/axis2/web/WEB-INF/conf
<module ref=”soapmonitor”/>

2. Place the applet classes into web application so that they can be loaded into the web browser. You can get the compiled applet classes from the WEB-INF/lib/axis2-soapmonitor-servlet-1.7.3.jar which is inside the extracted axis2.war. Unpack the jar file to the place IntegrationServer/packages/axis2/web

3. Use a web brower which support java applet like IE. Go to http://localhost:5565/web/axis2/SOAPMonitor. This will show the SOAP Monitor applet used to view the service requests and responses.

Enable Axis2 services

There is an issue with the addressing module because org.apache.axis2.handlers.addressing.AddressingInHandler is present both in the webMethods runtime and the addressing module shipped with Axis2. Since the module class loader is parent-first (and the class is not present in the Web application class loader), it is webMethods’s version of the class that will be loaded. This results in the following exception:

java.lang.ClassCastException: org.apache.axis2.handlers.addressing.AddressingInHandler incompatible with org.apache.axis2.engine.Handler

As a workaround, you can add a copy of the module file as JAR file to WEB-INF/lib folder. You can simply rename the mar file as jar file before copy it to lib folder.

Finally, you can access the Administration module use the following URL: http://localhost:5565/web/axis2/axis2-admin/

Click on System ComponentsAvailable Services, you can find default service called version has been deployed.

Add WSDL into SOAPUI http://localhost:5565/web/axis2/services/Version?wsdl and test from there. You can verify SOAP request and response from SOAP Monitor utility listed above.

You might be curious to find SOAP messages in server.log. Nope! As the URL contains the “/web” directive, Integration Server’s dispatcher forwards the request to the logic in the WmTomcat package.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s