I have a project coming up that will require me to call a SOAP web service from my java application. I’m wondering what toolsets I should look at to do this? All advice appreciated.
I’ve looked at jax-ws and Axis2 but these appear to be mostly for creators of web services instead of consumers and I only wish to consume.
Thanks!
First of all you need wsdl. Some service providers might distribute Java client classes, but WSDL is the safest approach.
Once you have it, run tool like
wsdl2javafor apache-cxf or analogous in apache-axis against it. It will create a bunch of Java classes (you only need the client side). These tools are also capable of generating server-side code, hence the impression you had that they aim service developers.This is all you need – the client classes will handle XML marshalling/unmarshalling and HTTP connectivity for you. Just use appropriate stub implementing WS endpoint interface.
You can also use
WebServiceTemplatefrom spring-ws portfolio.