How do you convert WSDLs to Java classes using Eclipse?

khris picture khris · Mar 17, 2014 · Viewed 165.9k times · Source

I have a WSDL file (or, more precisely, its URL). I need to convert it to Java classes. I also need to provide tests for the web service it describes. I'm new to web services, so could someone tell me how to convert WSDLs to Java?

I use Eclipse JEE Kepler. Maybe there are some plugins to do this automatically?

Answer

Ashok_Pradhan picture Ashok_Pradhan · Mar 17, 2014

In Eclipse Kepler it is very easy to generate Web Service Client classes,You can achieve this by following steps .

RightClick on any Project->Create New Other ->Web Services->Web Service Client->Then paste the wsdl url(or location) in Service Definition->Next->Finish

You will see the generated classes are inside your src folder.

NOTE :Without eclipse also you can generate client classes from wsdl file by using wsimport command utility which ships with JDK.

refer this link Create Web service client using wsdl