Recently I have to convert a WSDL file to Java code. I tried Axis2 Plugins with my Eclipse-Indigo and failed. I tried it in many ways but failed. Wasted my precious time and energy. I would like to suggest you one easy way i succeeded.
- Create a Java Project: File->New->Other->Java Project. (Suppose I named it TestWSDL)
- Create a WSDL File: File->New->Other->Web Services->WSDL File-> Name the file->Next->finish. (Suppose I named it NewWSDLFile.wsdl)
- Modify the WSDL File: Open NewWSDLFile.wsdl and replace all its content by your desired WSDL file.Save it. (Suppose I have saved my desired wsdl file at D:sampleWSDL.xml, which i want to convert. Open this xml file using Notepad++,copy all its content and paste it to NewWSDLFile.wsdl)
- Create Web Service Client: File->New->Other->Web Services->Web Service Client->Next->Browse Service definition and show the path of the NewWSDLFile.wsdl file we created at step 2 ->OK-> Click Client Project(blue colored link at right) and set it to the project we created at step 1.
- Press Next -> Set Output Folder->Finish.
- You will have all the converted Java files at the folder you set at step 5.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…