What is the best approach to do this JAVA?
I would personally NOT use Axis 2, even for client side development only. Here is why I stay away from it:
- I don’t like its architecture and hate its counter productive deployment model.
- I find it to be low quality project.
- I don’t like its performances (see this benchmark against JAX-WS RI).
- It’s always a nightmare to setup dependencies (I use Maven and I always have to fight with the gazillion of dependencies) (see #2)
- Axis sucked big time and Axis2 isn’t better. No, this is not a personal opinion, there is a consensus.
- I suffered once, never again.
The only reason Axis is still around is IMO because it’s used in Eclipse since ages. Thanks god, this has been fixed in Eclipse Helios and I hope Axis2 will finally die. There are just much better stacks.
I read about SAAJ, looks like that will be more granular level of approach?
To do what?
Is there any other way than using the WSDL2Java tool, to generate the code. Maybe wsimport in another option. What are the pros and cons?
Yes! Prefer a JAX-WS stack like CXF or JAX-WS RI (you might also read about Metro, Metro = JAX-WS RI + WSIT), they are just more elegant, simpler, easier to use. In your case, I would just use JAX-WS RI which is included in Java 6 and thus wsimport
.
Can someone send the links for some good tutorials on these topics?
That’s another pro, there are plenty of (good quality) tutorials for JAX-WS, see for example:
- Developing JAX-WS Web Service Clients (start here)
- Introducing JAX-WS 2.0 With the Java SE 6 Platform, Part 1
- Creating a Simple Web Service and Client with JAX-WS
- Creating a SOAP client with either Apache CXF or GlassFish Metro (Glen Mazza’s blog is a great resources)
What are the options we need to use while generating the code using the WSDL2Java?
No options, use wsimport
🙂
See also
- Elad’s Adventures in Java WebServiceLand
- Axis2: Why bother? on the BileBlog (be prepared for the bile) – you’ll have to stop the redirect.
Related questions
- What is the best java webservice framework?
- Spring-ws or Axis2 or Something else for “Contract-First” approach to WS