How can I access the exposed methods in a .wsdl
file using Java? Also, what are the steps involved in writing a Java client and consuming the webservices?
In addition to The Elite Gentleman's answer, here are my steps I successfully used to generate classes to be able to use the webservice: Command:
wsimport -Xnocompile -keep -b binding.xml wsdlFile.wsdl
Explanation:
I had the problem that the Java classes contained the JAXBElement
wrapper classes.
So instead of a class member of type String
, I would get the type JAXBElement
, which is horrible to use. With the -b
switch for wsimport
and the following binding.xml
file, you get the correct types:
I hope this helps. wsimport
then generates all the classes you need as well as a class containing methods for all your webservices' methods.
By default, these methods don't have a read timeout (talking network problems while requesting...), see here for a question I had back then.