Frage

I have a WSDL url(http:localhost:8080/userdata?wsdl) and I want to create a request to this webservice so I can fetch the data for further processing. Can I do this without wsimport?

If I have to create package from wsimport, how I can create a client which will use generated classes to create the XML request?

If I can do this without wsimport , how I can create a client which will create the XML request?

New to webservices, links to documentation would be appreciated. I am trying to understand this at the moment http://java.dzone.com/news/5-techniques-create-web-servic

War es hilfreich?

Lösung

You can use CXF wsdl2Java to generate a client code for the web service.

Once you run the wsdl2java , you will get a set of java classes generated for you. You can then use those classes to call the services without any explicit conversion of XML - the underlying framework will do it for you automatically. You can start with http://cxf.apache.org/docs/how-do-i-develop-a-client.html

I proposed CXF while you can look for many other alternatives - However, i have found CXF to be very feature rich and will help you in developing/working with web services.

Andere Tipps

On top of what Akhilesh said you can also create a Dynamic client for invoking WSDL. I have done it recently and i found it a little bit better then using CXF as dynamic client does not generate any code whatsoever. You just pass in the parameters to it and it does all the job for you. You can find a "shell" to build your own client HERE

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top