ITeye博客

用Axis创建的Webservice的集成与发布

qingfeng825 · 2007-12-07 14:53 · webservice · Apache · WebService · XML · Web · Servlet · Markdown

axis可以随意部署在大部分web application server上,如:tomcat。它与你自己部署的应用几乎没有任何的耦合关系你只需要在你的web.xml中配置一下axis就可以正常使用了。这样我们能够很方便的将axis集成到我们自己开发的项目上。具体的配置如下:[code] org.apache.axis.transport.http.AxisHTTPSessionListener AxisServlet Apache-Axis Servlet org.apache.axis.transport.http.AxisServlet AdminServlet Axis Admin Servlet org.apache.axis.transport.http.AdminServlet 100 SOAPMonitorService SOAPMonitorService org.apache.axis.monitor.SOAPMonitorService SOAPMonitorPort 5001 100 AxisServlet /servlet/AxisServlet AxisServlet *.jws AxisServlet /services/* SOAPMonitorService /SOAPMonitor 5 wsdl text/xml xsd text/xml [/code] 只要将上述的配置信息加入到你的web应用中就可以将Axis集成到你自己的项目中去了。还有一点需要说明,那就是除了这个配置以外还有将你的Axis.jar和其他必要的jar文件加入到你的WEB-INF/lib目录中,以及发布你的的webservice的classes到WEB-INF/classes/中。 需要说明的有下面两个配置:[code] AxisServlet /services/* [/code] 这个配置了指出所有webservice的访问都是以 "web应用名/service/webservice名称" 的形式来访问的。你可以更改它的名字,但是请注意。这个需要与你的其他webservice配置文件匹配或者说同步。如WEB-INF下的server-config.wsdd文件中对webservice的配置。还有java2wsdl和wsdl2java工具生成的代码中的配置。如:wsdl2java工具生成的类MobileBossServiceLocator 类中的这个URL的默认配置 private java.lang.String MobileBoss_address = "http://localhost:8080/axis/services/MobileBoss"; 除了上面的那个配置以外还有一个比较重要的配置: [code] AxisServlet *.jws [/code] 这个是通过jws既java源代码的方式发布webservice。这种情况用的比较少。知道有这个配置才能使用jws就可以了。 当然了除了这两个配置以外还有许多配置如timeout配置和监控器配置,这里就不多说了。我会在以后的高级应用中说明其他配置的功用。祝大家工作顺利。that's all!

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。