接上一篇 java2wsdl+Axis2+hibernate开发webservice学习(1)
一、自定义module
---com.mywebservice.ws.module
---AuditLogModule.java
---AuditInHandler.java
---AuditOutHandler.java
AuditLogModule.java
AuditInHandler.java
AuditOutHandler.java
二、编译并copy build/classes mode文件到WebConten/WEB-INF/modules下,并创建module.xml
---mymodule
---com
---...
---META-INF
---module.xml
三、修改axis2.xml
打开/conf/axis2.xml,增加module的配置:
其中<phase name="auditLogPhase"/> 为自定义的。
四、修改services.xml
增加<module ref="auditLogger"/>
五:deploy工程
以Tomcat为例
六:测试,run the test
OnePassTester.java/@Test testGetUserProfile1()
测试结果:
后台打印信息
--- initializing AuditLogModule
--- AuditInHandler beginning...
--- AuditOutHandler beginning...