I was playing around with Axis2. Developing some POC type web services to understand the new capabilities that Axis has added in its armoury.
Apparently Axis provides a ready-to-use tool for monitoring the SOAP messages flowing between the Axis web service and its consumers. The tool is called SOAPMonitor and information regarding the installation is available here. I followed the instructions mentioned in the site and found to my utter dismay, the appletclassloader throwing NoClassFoundException. Did some googling and found a host of solutions which unfortunately did not solve the problem at hand.
Finally here’s what I did which solved the issue. I created a custom HTML page test.html.
The HTML contents are as below:
<HTML> <HEAD> <TITLE>SOAP Monitor</TITLE> </HEAD> <BODY> <H1>Hello There</H1> <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width=100% height=100% codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"> <param name="code" value="SOAPMonitorApplet.class"/> <param name="type" value="application/x-java-applet;version=1.3"/> <param name="scriptable" value="false"/> <param name="port" value="5001"/> <comment> <embed type="application/x-java-applet;version=1.3" code=org.apache.axis2.soapmonitor.applet.SOAPMonitorApplet.class width=100% height=100% port=\"" + port + "\" scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"> <noembed> </noembed> </embed> </comment> </object> </BODY> </HTML>
The content of the HTML is similar to the HTML page generated by the SOAPMonitorService servlet. I made some minor modifications to that HTML rendition. In the param named code instead of referring to the entire class name i.e org.apache.axis2.soapmonitor.applet.SOAPMonitorApplet.class, we pass the value “SOAPMonitorApplet.class”. The param port was hardcoded to 5001 which is the default port for sOAP monitoring. Ensure that you have JDK 1.3 and higher java plugin installed on your web browser. The contents within comment tag apparently do not impact the final page rendition. I took the source code of SOAPMonitorApplet class and made some modifications.
- The package name of the class was changed from org.apache.axis2.soapmonitor.applet. to default package, i.e. no package name.
- SOAPMonitorApplet class had a dependency on SOAPMonitorConstants class. That dependency was removed and the values for SOAP_MONITOR_REQUEST and SOAP_MONITOR_RESPONSE was hard coded in the SOAPMonitorApplet class.
- The SOAPMonitorApplet class was compiled and deployed to webapps\axis2 folder, provided axis2 is the axis webservices route folder.
- I removed the soapmonitor-1.4.jar from the webapps\axis2\WEB-INF\lib folder. All classes within the org.apache.axis2.soapmonitor.servlet package were deployed within the webapps\axis2\WEB-INF\classes folder.
- The newly created HTML test.html was deployed in the webapps\axis2 folder. The HTML was co-located with the applet class.
I started the Tomcat server and presto the SOAPMonitor was up and running. Note the deployment was done on Tomcat 5.5