简体   繁体   English

在Tomcat上部署JAX-WS Web服务

[英]Deploying JAX-WS web service on Tomcat

After noticing Java 6 includes javax.xml.ws , I'm able to create a standalone web service. 在注意到Java 6包含javax.xml.ws之后 ,我就能够创建一个独立的Web服务。 How would I go about hosting that in Tomcat 6? 我将如何在Tomcat 6中托管它?

You will need to download the JAX-WS RI (Reference Implementation) jax-ws.dev.java.net. 您需要下载JAX-WS RI(参考实现)jax-ws.dev.java.net。 The https://jax-ws.dev.java.net/nonav/2.1.2m1/docs/samples.html page lists some tips at the bottom of the page on setting up Tomcat for JAX-WS RI. https://jax-ws.dev.java.net/nonav/2.1.2m1/docs/samples.html页面列出了有关为JAX-WS RI设置Tomcat的页面底部的一些提示。

Specifically for Tomcat 6, you will need to: 特别是对于Tomcat 6,您需要:

Edit $CATALINA_HOME/conf/catalina.properties and set shared.loader={RI Installation Directory}/lib/*.jar. 编辑$ CATALINA_HOME / conf / catalina.properties并设置shared.loader = {RI安装目录} / lib / * .jar。 If you are running multiple instances of Tomcat, then edit CATALINA_BASE/conf/catalina.properties for that particular instance. 如果您正在运行多个Tomcat实例,请编辑该特定实例的CATALINA_BASE / conf / catalina.properties。 The same technique can be used with Tomcat 5.x if you don't like to copy all the jars to $CATALINA_HOME/shared/lib 如果您不想将所有jar复制到$ CATALINA_HOME / shared / lib,则可以将相同的技术与Tomcat 5.x一起使用

Download metro from here and execute this jar as 这里下载地铁并执行此jar作为

java -jar metro-2_0-ea.jar

The metro directory contains two ant files, metro-on-glassfish.xml and metro-on-tomcat.xml. metro目录包含两个ant文件,metro-on-glassfish.xml和metro-on-tomcat.xml。 These two files are used to install the Metro binaries into the respective web containers. 这两个文件用于将Metro二进制文件安装到相应的Web容器中。

The installation process for Tomcat: Tomcat的安装过程:

  1. shutdown.bat (Tomcat shutdown) shutdown.bat(Tomcat关闭)

  2. Execute below line on command prompt 在命令提示符下执行以下行

ant -Dtomcat.home= -f /metro-on-tomcat.xml install ant -Dtomcat.home = -f /metro-on-tomcat.xml安装

startup.bat (Tomcat start) startup.bat(Tomcat开始)

the installation process copies the two Metro jar files into Tomcat's shared/lib directory. 安装过程将两个Metro jar文件复制到Tomcat的shared / lib目录中。 No Tomcat configuration files are modified. 没有修改Tomcat配置文件。

Or you can use Apache CXF which is a full-featured JAX-WS implementation. 或者您可以使用Apache CXF ,这是一个功能齐全的JAX-WS实现。 No extra configurations - only one Servlet. 没有额外的配置 - 只有一个Servlet。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM