Java Webservice Client (best way)

I have a third-party WSDL, I need to write code in JAVA for a web service client to invoke operations in a third-party WSDL. Right now, I created a client stub using the Axis WSDL2JAVA tool and used XMLbeans to bind data.

  • What is the best approach for this JAVA?
  • I read about SAAJ, it looks like this will be a more granular approach level?
  • Is there any other way than using the WSDL2Java tool to generate code. Maybe wsimport in another version. What are the pros and cons?
  • Can someone post links for some good guides on these topics?
  • What parameters do we need to use when generating code using WSDL2Java?

At first I used some of the basic things. I now have these options

 C:\axis2-1.5.1\bin>wsdl2java -uri mywsdlurl -o client -p somepackage -d xmlbeans -s -t -ssi 
+79
java jax-ws wsdl2java webservice-client axis2
Aug 27 2018-10-10T00:
source share
4 answers

What is the best approach for this JAVA?

I personally would NOT use Axis 2, even for client side development. This is why I stay away from him:

  • I do not like its architecture and hate its productive deployment model.
  • I think this is a low quality project.
  • I do not like his performances (see this test against JAX-WS RI ).
  • It's always a nightmare for installing dependencies (I use Maven and I always to fight gazillion dependencies) (see # 2)
  • The axis sucked for a long time, and Axis2 is no better. No, this is not a personal opinion, there is consensus.
  • I suffered once, never again.

The only reason Axis is still located is IMO, as it has been used in Eclipse with age. Thank goodness this has been fixed in Eclipse Helios and I hope Axis2 will finally die. There are much better stacks.

I read about SAAJ, looks like this will be a more granular approach level?

What to do?

Is there any other way than using the WSDL2Java tool to generate code. Perhaps wsimport is in a different version. What are the pros and cons?

Yes! Prefer a JAX-WS stack, like CXF or JAX-WS RI (you can also read about Metro, Metro = JAX-WS RI + WSIT ), they are simply more elegant, simpler, easier to use. In your case, I would just use the JAX-WS RI, which is included in Java 6 and therefore wsimport .

Can someone post links for some good guides on these topics?

In this other pro, there are many (good quality) tutorials for JAX-WS, see for example:

What parameters do we need to use when generating code using WSDL2Java?

No options, use wsimport :)

see also

Related Questions

  • What is the best java webservice infrastructure?
  • Spring-ws or Axis2 or something else for the "Contract-First" approach to WS
+155
Aug 28 '10 at 9:40
source share

I had good success using Spring WS for the client end of a web service application - see http://static.springsource.org/spring-ws/sites/1.5/reference/html/client.html

My project uses a combination of:

  • XMLBeans (generated from a simple Maven job using xmlbeans-maven-plugin)

  • Spring WS - using marshalSendAndReceive () reduces the code to one line to send and receive

  • some Dozer - mapping complex XMLBeans to simple beans for the client GUI

+7
Aug 27 '10 at 23:16
source share

You can find some resources related to building a web services client using Apache axis2 here.

http://today.java.net/pub/a/today/2006/12/13/invoking-web-services-using-apache-axis2.html

The following is a good explanation of creating web services using Apache axis2.

http://www.ibm.com/developerworks/opensource/library/ws-webaxis1/

http://wso2.org/library/136

+1
25, Mar. 2018-12-25T00:
source share

Some ideas in the following answer:

Steps to Create a Web Service Using Axis2 - Client Code

Provides an example Groovy client calling ADB classes generated from WSDL.

There are many web service infrastructures ...

0
Aug 28 2018-10-12T00:
source share



All Articles