WebService Axis2 (10): Monitoring SOAP Request and response messages using the Soapmonitor module

Source: Internet
Author: User
Tags soap tomcat

A Axis2 module (soapmonitor) is provided in Axis2, which implements the same function as the Axis2 module implemented in AXIS2 (9): Writing logging module (module) in the WebService Auditorium, The logging module outputs SOAP request and response messages directly to the Tomcat console, while the Soapmonitor module uses applets to output SOAP request and response messages directly from the page.

The following are steps for configuring and using the Soapmonitor module:

Step 1th: Deploy applets and servlet

Because Axis2 has the Soapmonitor module by default, the Soapmonitor module does not need to be installed separately. However, the corresponding. class files involved in the applet need to be installed. Locate the Soapmonitor-1.4.1.jar file in the <tomcat installation directory >\webapps\axis2\web-inf\lib directory and unzip the file. Although the applet does not require all the. class files in the Soapmonitor-1.4.1.jar file, the reader can also copy the Org directory in the extracted directory directly to the <TOMCAT installation directory for convenience >\webapps\ In the Axis2 directory, the. class file required by the applet needs to be placed in this directory. The org directory is then copied to the <tomcat installation directory >\webapps\axis2\web-inf\classes directory, and the corresponding. class file for the servlet in the Soapmonitor module needs to be placed in this directory.

Step 2nd: Configure the Servlet

Open the <tomcat installation directory >\webapps\axis2\web-inf\web.xml file and add the following:

<servlet>
   <servlet-name>SOAPMonitorService</servlet-name>
   <servlet-class>
     org.apache.axis2.soapmonitor.servlet.SOAPMonitorService
   </servlet-class>
   <init-param>
     <param-name>SOAPMonitorPort</param-name>
     <param-value>5001</param-value>
   </init-param>
   <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
   <servlet-name>SOAPMonitorService</servlet-name>
   <url-pattern>/SOAPMonitor</url-pattern>
</servlet-mapping>

Step 3rd: Referencing the Soapmonitor module in the Services.xml file

As with referencing the logging module, the Reference Soapmonitor module also requires the use of the <module> element, and the Services.xml file referencing the Soapmonitor module reads as follows:

<service name= "MyService" >
    <description>
        using logging and Soapmonitor modules
    </description>
    <!--  Reference logging module  -->
    <module ref= "Logging"/>
    <!--  reference Soapmonitor module  -->
    <module ref= "Soapmonitor"/> <parameter "name="
    >
        service. MyService   
    </parameter>
    <messageReceivers>
        <messagereceiver mep= "http://www.w3.org /2004/08/wsdl/in-out "
            class=" Org.apache.axis2.rpc.receivers.RPCMessageReceiver "/>
    </ Messagereceivers>
</service>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.