问题
I am using Apache Tomcat v6 server. While creating a new Web Service, I get the Web service runtime options for "Apache Axis", "Apache Axis2" and "Apache CXF2.x".
Is it possible to have the runtime as "JAX-RPC" or "Jax-WS"?
EDIT:
I am using Eclipse IDE
回答1:
JAX-RPC and JAX-WS are specifications, Axis, Axis2 and CXF are implementations.
- for JAX-RPC you need Axis (1)
- for JAX-WS use CXF (I believe Axis2 also supports this spec but I've never used it)
If you have a choice I strongly recommend the latter (JAX-WS) as it's the more modern spec and more importantly the toolkits are being actively developed and updated - Axis 1 has been dormant for years and relies on old versions of a number of other libraries.
You're also likely to get better performance with a more modern toolkit like CXF or Axis2, which has been designed from the beginning to use streaming XML APIs wherever possible, rather than building a tree model in memory.
回答2:
I'd like to expand and upon Ian Roberts answer and give you more options.
JAX-RPC
This is an older standerd. You can still find an implementation for it JAX-RPC SI (standard implementation) : http://java.net/projects/jax-rpc/
Also, many of the JAX-WS implementations will implement the old JAX-RPC standard. JAX-WS replaced JAX-RPC and you shouldn't really need it if you are creating a new project.
JAX-WS
JAX-WS standard: http://jcp.org/en/jsr/detail?id=224
JAX-WS implementations:
JAX-WS RI (reference implementation) : http://jax-ws.java.net/
Apache CXF : http://cxf.apache.org/docs/jax-ws-configuration.html
Apache Axis2 : http://axis.apache.org/axis2/java/core/
JBOSS-WS: http://www.jboss.org/jbossws (Easy if you choose jboss over a bare tomcat, pros and cons come along with this)
Choosing the right library
If you just want to get something up and running you can just have eclipse use Axis2 or CXF. (Just google "Eclipse Axis2" or "Eclipse CXF" and you'll find plenty of tutorials and videos on getting up and running.) I personally use JAX-WS RI, but all of the above options have pros and cons.
回答3:
I can only answer a half of this question. Yes, it's possible to run JAX-WS and JAX-RPC on Tomcat 6:
JAX-WS
http://www.mkyong.com/webservices/jax-ws/deploy-jax-ws-web-services-on-tomcat/
OR
http://puretech.paawak.com/2010/03/09/running-jax-ws-with-tomcat/
JAX-RPC
see the last 2 paragraphs at http://tomcat.apache.org/tomcat-6.0-doc/extras.html#Components_list and try to experiment
来源:https://stackoverflow.com/questions/13784763/jax-rpc-jax-ws-runtime-in-apache-tomcat