0
votes

I am given a WSDL file. I need to call a SOAP web service in the WSDL. I would like to know the different ways of creating a web service clients from a WSDL in java. It would be helpful if the options are given with examples, links, pros and cons. I am now confused with different options like wsimport, wsdl2java, java2wsdl, saaj, apache axis, cxf, spring etc. Your help is much appreciated.

3
Run wsdl2java (even via a GUI like SoapUI). It generates a class with a main() method that you can immediately play withRaffaele
wsimport is part of JAX-WS, which is part of every Java SE installation; no third-party libraries required. Like all of Java SE, JAX-WS is heavily regression tested and extremely stable (meaning, its contracts will never change).VGR

3 Answers

1
votes

SoapUI doesn't support WSDL 2.0

You may try an experimental wsdl-generic library from Apache Taverna

The library works with both WSDL 1.1 / 2.0 versions. The experimental branch creates XML tree based on Apache XML Schema 2.0 library, so you can easily create your XML message.

Then it dynamically calls the service via JAX-WS.

It also has a command-line WS executor!!!

Cheers,

D.

0
votes

I was working on a project using Salesforce SOAP API, and here is a link of the guide for using WSDL to generate java lib:

https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_quickstart_import_WSDLs.htm

Hope it will help you.

0
votes

SoapUI is a quick solution with user interface to make initial tests for provided web service methods. Later you can use wsdl2java with specific options to generate Java classes from WSDL and make jar which you will include in your project.