7

I've a WSDL file and i need to convert it into java, so for this i use step by step procedure from below link

http://axis.apache.org/axis2/java/core/tools/eclipse/wsdl2java-plugin.html

like adding axis2 codegen jar file into dropins folder in eclipse folder and restarted eclipse but i didn't get "Axis2 Wizard" in my eclipse IDE, so any one plz help me to get out of this.

Thanks, @nagaraju.

nag
  • 920
  • 6
  • 27
  • 51
  • Axis2 support is available since WTP 2.0, which is present in every Eclipse distribution since Europa (Eclipse 3.3). Install that if you haven't done so. Now, if you can be more specific about your problem, and describe it like a developer with Eclipse error logs, instead of an end-user, you might get more help. – Vineet Reynolds Aug 11 '11 at 04:26
  • Thanks for your post, i've seen here http://axis.apache.org/axis2/java/core/tools/eclipse/plugin-installation.html that inorder to work axis2 codegen jar file i need to use eclipse ide for java ee so currently i'm downloading that one is this helpful for me? – nag Aug 11 '11 at 04:35
  • Yes, if you haven't installed the Axis2 runtime and configured Eclipse to locate it, the codegen plugin will not work. – Vineet Reynolds Aug 11 '11 at 04:40
  • But currently 'm developing android apps so in java ee ide not supporting android app, so now 'm downloading eclipse ide 3.3 will it work for me to do this? – nag Aug 11 '11 at 05:08

3 Answers3

9

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.

  1. Create a Java Project: File->New->Other->Java Project. (Suppose I named it TestWSDL)
  2. Create a WSDL File: File->New->Other->Web Services->WSDL File-> Name the file->Next->finish. (Suppose I named it NewWSDLFile.wsdl)
  3. 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)
  4. 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.
  5. Press Next -> Set Output Folder->Finish.
  6. You will have all the converted Java files at the folder you set at step 5.
User
  • 126
  • 1
  • 3
3

There are two things you can do here. You can use that plugin or use web service wizard(which is available in Eclipse 3.3 also).

(i) Using the plugin:: You can download the latest Eclipse WSDL2JAVA Codegen plugin, paste it in the plugins folder of eclipse folder. Start the eclipse and you can find the Axis Codegen plugin on pressing ('Ctrl+N') or under 'File/New/Other/Axis'

(ii) Using the Web Service plugin: Press 'Ctrl+N ', and go to Web Service/Web Service Client. Paste the url(WSDL), select the client project you are working on, press next, specify the output folder and press finish.

Any of these two steps will generate the client stub(java code) for the wsdl you have given.

Anuj Balan
  • 7,629
  • 23
  • 58
  • 92
  • thanks for your post, i added plugin in eclipse ide for java ee but there android app is not working becoz 'm developing android app. So currently i'm downloading eclipse ide 3.3 will it work for me? – nag Aug 11 '11 at 05:07
  • I've used it with Eclipse IDE 3.3 and Eclipse 3.6 -modeling tools Versions and it has worked. – Anuj Balan Aug 11 '11 at 05:08
  • ya just now i downloaded Eclipse IDE 3.3 but i didn't found android sdk manager in it? – nag Aug 11 '11 at 05:17
  • I am talking about the plugin which you wanted in order to convert wsdl 2 java. This plugin can be added and used. I have never used the android app and do not have much idea bout it. – Anuj Balan Aug 11 '11 at 05:20
  • Ok when i tried to add wsdl file from disk location it shows Invalid wsdl file how can i overcome this? – nag Aug 11 '11 at 05:44
  • File is having .wsdl extension ? If yes,then it will allow you to proceed further. Try again. – Anuj Balan Aug 11 '11 at 05:47
  • You can otherwise use Web Service/Web Service Client do generate the code from wsdl. Try that too. – Anuj Balan Aug 11 '11 at 05:48
  • Ya my file name is "Auth.wsdl" its in loc D:\wsdls\Auth.wsdl so i select location like this but it shows invalid wsdl file. – nag Aug 11 '11 at 06:01
  • Open wsdl in some browser, copy the link and paste it. Try this way otherwise. – Anuj Balan Aug 11 '11 at 06:08
  • ya same when i open in browser i'm getting link as "D:\Auth.wsdl" then i pasted this link but still i didn't get it :( – nag Aug 11 '11 at 06:28
2

i founded this tool to auto generate wsdl to android code,

http://www.wsdl2code.com/example.aspx

 SampleService srv1 = new SampleService();
 req = new Request();                     
 req.companyId = "1";
 req.userName = "userName";                                     
 req.password = "pas";
 Response response =    srv1.ServiceSample(req);
Bennya
  • 554
  • 5
  • 10