| Author |
jax-ws client different between axis2 eclipse and wsimport.
|
Stuart Swearengen
Greenhorn
Joined: Nov 02, 2006
Posts: 26
|
|
I'm sure i have the wrong end of the stick.
Using eclipse (ganymede and web tools) I have a simple pojo service. When I generate the client in eclipse, I get files like servicenameCallbackHandler and servicenamestub. That's using axis2, if my settings are correct.
If I use wsimport I get a client with an object factory and serviceporttype/service and response.
The axis2 samples also use clients that have the object factory type client.
Q. Am I using axis2 incorrectly in eclipse?
Q. Is the service.xml wrong and that the problem?
Q. shoudl axis 2 jax-ws output outputfactory clients?
Thanks.
|
 |
Peer Reynders
Bartender
Joined: Aug 19, 2005
Posts: 2906
|
|
"stu",
Please check your private messages regarding an important administrative matter.
|
"Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
|
 |
Peer Reynders
Bartender
Joined: Aug 19, 2005
Posts: 2906
|
|
wsimport is a command line tool for the JAX-WS reference implementation that ships with the JDK 6. The JAX-WS RI uses JAXB for data-binding.
Axis2 merely implements the JAX-WS API to some extent, so the Java artifacts generated can be quite different compared to those generated by the JAX-WS RI. Also Axis2 doesn't use JAXB but instead offers the choice of ADB (default), Apache XmlBeans, or JiBX for data-binding.
Both JAXB and XmlBeans generate "ObjectFactory" classes.
Your Eclipse/WTP environment is probably generating Axis2/ADB code, the Axis2 samples refer to Axis2/XmlBeans examples and wsimport is using the JAX-WS/JAXB RI from the JDK 6.
|
 |
Stuart Swearengen
Greenhorn
Joined: Nov 02, 2006
Posts: 26
|
|
Thanks for that. It's 100% useful. I'll dig more into those.
If you want to write once and be able to port between tomcat and websphere, would one implementation be better over another?
|
 |
Peer Reynders
Bartender
Joined: Aug 19, 2005
Posts: 2906
|
|
It depends:
Older versions of WebSphere use JAX-RPC web services. More recent versions are JAX-WS based.The JAX-WS RI requires a minimum of JDK 5 Update 2 and Servlet 2.4. Axis2 (without annotation support) can run on JDK 1.4.The JAX-WS RI can run on Tomcat 5.5 and Tomcat 6.x, Axis2 can run on lower versions than that.
In the end I'm not even sure that "write once and deploy to tomcat and websphere" is a realistic objective. Theoretically once you have successfully deployed the framework to your servlet container(s) you should be able to deploy the web services as WARs or AARs - however I would test that in the real environments before relying on it. Note however that pre-Servlet 2.5 based web services are not ideal if you need to support comet web applications which use long-standing HTTP requests. For that application area NIO-based servers like Grizzly or Apache MINA are better suited.
|
 |
 |
|
|
subject: jax-ws client different between axis2 eclipse and wsimport.
|
|
|