用Axis创建的Webservice的集成与发布(上)
转自:http://yangyang.iteye.com/blog/57991
axis可以随意部署在大部分web application server上,如:tomcat。它与你自己部署的应用几乎没有任何的耦合关系你只需要在你的web.xml中配置一下axis就可以正常使用了。这样我们能够很方便的将axis集成到我们自己开发的项目上。具体的配置如下:
xml 代码
1.<listener>
2. <listener-class>org.apache.axis.transport.http.AxisHTTPSessionListenerlistener-class>
3. listener>
4. <servlet>
5. <servlet-name>AxisServletservlet-name>
6. <display-name>Apache-Axis Servletdisplay-name>
7. <servlet-class>
8. org.apache.axis.transport.http.AxisServlet
9. servlet-class>
10. servlet>
11. <servlet>
12. <servlet-name>AdminServletservlet-name>
13. <display-name>Axis Admin Servletdisplay-name>
14. <servlet-class>
15. org.apache.axis.transport.http.AdminServlet
16. servlet-class>
17. <load-on-startup>100load-on-startup>
18. servlet>
19. <servlet>
20. <servlet-name>SOAPMonitorServiceservlet-name>
21. <display-name>SOAPMonitorServicedisplay-name>
22. <servlet-class>
23. org.apache.axis.monitor.SOAPMonitorService
24. servlet-class>
25. <init-param>
26. <param-name>SOAPMonitorPortparam-name>
27. <param-value>5001param-value>
28. init-param>
29. <load-on-startup>100load-on-startup>
30. servlet>
31. <servlet-mapping>
32. <servlet-name>AxisServletservlet-name>
33. <url-pattern>/servlet/AxisServleturl-pattern>
34. servlet-mapping>
35. <servlet-mapping>
36. <servlet-name>AxisServletservlet-name>
37. <url-pattern>*.jwsurl-pattern>
38. servlet-mapping>
39. <servlet-mapping>
40. <servlet-name>AxisServletservlet-name>
41. <url-pattern>/services/*url-pattern>
42. servlet-mapping>
43. <servlet-mapping>
44. <servlet-name>SOAPMonitorServiceservlet-name>
45. <url-pattern>/SOAPMonitorurl-pattern>
46. servlet-mapping>
47.<session-config>
1.
2. <session-timeout>5session-timeout>
3. session-config>
4.<mime-mapping>
1. <extension>wsdlextension>
2. <mime-type>text/xmlmime-type>
3. mime-mapping>
4. <mime-mapping>
5. <extension>xsdextension>
6. <mime-type>text/xmlmime-type>
7. mime-mapping>
只要将上述的配置信息加入到你的web应用中就可以将Axis集成到你自己的项目中去了。还有一点需要说明,那就是除了这个配置以外还有将你的Axis.jar和其他必要的jar文件加入到你的WEB-INF/lib目录中,以及发布你的的webservice的classes到WEB-INF/classes/中。