Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

jax-ws client different between axis2 eclipse and wsimport.

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"stu",

Please check your private messages regarding an important administrative matter.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
     
    To do a great right, do a little wrong - shakepeare. twisted little ad:
    Java file APIs (DOC, XLS, PDF, and many more)
    https://products.aspose.com/total/java
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!