In Axis2 Provides Axis2 Module ( Soapmonitor ), This module implements Axis2 (9) of WebService Lecture Hall: compiling axis2 Module Implemented in Logging Modules share the same functions. what is different is that, Logging Module directly Soap Request and response messages are output Tomcat Console, and Soapmonitor Module Exploitation Applet Output directly on the page Soap Request and response messages.
The following describes how to configure and useSoapmonitorSteps of the module:
The1Step: deployAppletAndServlet
Because Axis2 By default Soapmonitor Module, therefore, Soapmonitor The module does not need to be installed separately. However Applet The corresponding . Class Install the file. In <Tomcat Installation Directory & Gt; \ webapps \ axis2 \ WEB-INF \ LibDirectory Soapmonitor-1.4.1.jar To decompress the file. Although Applet Not Required Soapmonitor-1.4.1.jar All files . Class Files, but for convenience, you can directly extract Org Directory copy <Tomcat Installation Directory > \ Webapps \ axis2 Directory, Applet Required . Class The file must be placed in this directory. Then Org Directory copy <Tomcat Installation Directory > \ Webapps \ axis2 \ WEB-INF \ Classes Directory, Soapmonitor Module Servlet Corresponding . Class The file must be placed in this directory.
The2Step: ConfigureServlet
Open<TomcatInstallation Directory> \ Webapps \ axis2 \ WEB-INF \ WEB. xmlFile, add the following content to it:
< 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 >
The3Step: goServices. xmlFile ReferenceSoapmonitorModule
Like referencing the logging module, you also need to use the <module> element to reference the services. xml file of the soapmonitor module as follows:
< Service Name = "Myservice" >
< Description >
Use the logging and soapmonitor modules
</ Description >
<! -- Reference the logging Module -->
< Module Ref = "Logging" />
<! -- REFERENCE The soapmonitor Module -->
< Module Ref = "Soapmonitor" />
< Parameter Name = "Serviceclass" >
Service. myservice
</ Parameter >
< Messagereceivers >
< Messagereceiver MEP = "Http://www.w3.org/2004/08/wsdl/in-out"
Class = "Org. Apache. axis2.rpc. Receivers. rpcmessagereceiver" />
</ Messagereceivers >
</ Service >
BecauseSoapmonitorThe module is already inAxis2.xmlTherefore, you do not need to configureAxis2.xmlFile.
The4Step: UseSoapmonitorModule
After Tomcat is started, enter the following URL in the browser:
HTTP: /localhost: 8080/axis2/soapmonitor
Will appear in the browserSoapmonitorTheAppletWhen accessingMyserviceOfGetgreetingInTomcatConsole andAppletThe correspondingSoapRequest and response messages.1And Graph2They were called twice.GetgreetingMethod outputSoapRequest and response messages.
Figure 1
Figure 2
If you wantLoggingAndSoapmonitorModule monitoring is deployed inAxis2AllWebService, You canAxis2.xmlFile<Module>Element to reference these two modules,CodeAs follows:
<! -- Reference the logging Module -->
< Module Ref = "Logging" />
<! -- REFERENCE The soapmonitor Module -->
< Module Ref = "Soapmonitor" />