You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Bill Somerville <bi...@scalable.com> on 2009/07/08 18:25:26 UTC
Problems generating client-side stubs from published WSDL
Hi. I'm a relative newbie to all of this, so apologies in advance. I'm writing a Java client to interface with a published service (from Intel). I'm running into a couple of logistical problems that are making life difficult:
1. Using the stock Eclipse "Web Service Client" tool, the WSDL imports fine, but not all of the classes I need are generated (probably those not directly referenced). I need all classes, due in part to poor design of the interface on Intel's part, no doubt. Since there are few options with the Eclipse tool, I decided to explore WSDL2Java...
2. Using WSDL2Java -u, I get roughly the same results as with the Eclipse plug-in. However, adding -g generates all of the classes I need. But, the doc spew says that -g is only valid in conjunction with -ss, and I'm working on a client only.
3. Regardless of -g, the code generated by WSDL2Java is huge in comparison to the code generated by the Eclipse plugin (10x). The WSDL2Java code appears to have a bunch of extra stuff related to XMLWriter, etc.
So, questions:
1. Is there a way to coerce the stock Eclipse plugin to do what I need (generate all classes), or should I explore the Axis2 Eclipse plugin? (I see varying levels of success getting it working, but haven't tried myself).
2. Should I just use WSDL2Java and be done with it? Since the stub generation is more or less a one-time thing in my case, I don't mind using WSDL2Java, but am concerned about the bloat of the generated code, and the potential conflict of using -g on a client. I haven't yet found the magic set of command line options to cause it to eliminate all of the "extra" code it generates. Is there a way to eliminate this (presumably) extra code?
3. Both Eclipse and WSDL2Java seem to do a poor job of generating enums, though this seems to be a well-documented issue. Looking at JIRA, this seems to be fixed - any timeframe on a release that includes proper enum support? (In the mean time, I'm wrapping the generated enums to make them look like they should).
Eclipse 3.4 (Ganymede) w/Axis2 1.4 (I think)
Axis2 1.4 and 1.4.1 (tried both)
BTW, my code works, so these are mostly logistical/efficiency issues, though I haven't yet tried the WSDL2Java-generated code.
Many thanks...
-- Bill
RE: Problems generating client-side stubs from published WSDL
Posted by Bill Somerville <bi...@scalable.com>.
Ouch! Never mind, being a newbie, I was confused by Axis vs. Axis2. Eclipse ships with Axis, not Axis2, and after digging-out and downloading Axis 1.4, I get all my stubs looking as they are in Eclipse. Still need to use WSDL2Java to get all of the classes, but that's probably an Eclipse issue.
Sorry...
-- Bill
-----Original Message-----
From: Bill Somerville [mailto:bill.somerville@scalable.com]
Sent: Wednesday, July 08, 2009 12:25 PM
To: 'axis-user@ws.apache.org'
Subject: Problems generating client-side stubs from published WSDL
Hi. I'm a relative newbie to all of this, so apologies in advance. I'm writing a Java client to interface with a published service (from Intel). I'm running into a couple of logistical problems that are making life difficult:
1. Using the stock Eclipse "Web Service Client" tool, the WSDL imports fine, but not all of the classes I need are generated (probably those not directly referenced). I need all classes, due in part to poor design of the interface on Intel's part, no doubt. Since there are few options with the Eclipse tool, I decided to explore WSDL2Java...
2. Using WSDL2Java -u, I get roughly the same results as with the Eclipse plug-in. However, adding -g generates all of the classes I need. But, the doc spew says that -g is only valid in conjunction with -ss, and I'm working on a client only.
3. Regardless of -g, the code generated by WSDL2Java is huge in comparison to the code generated by the Eclipse plugin (10x). The WSDL2Java code appears to have a bunch of extra stuff related to XMLWriter, etc.
So, questions:
1. Is there a way to coerce the stock Eclipse plugin to do what I need (generate all classes), or should I explore the Axis2 Eclipse plugin? (I see varying levels of success getting it working, but haven't tried myself).
2. Should I just use WSDL2Java and be done with it? Since the stub generation is more or less a one-time thing in my case, I don't mind using WSDL2Java, but am concerned about the bloat of the generated code, and the potential conflict of using -g on a client. I haven't yet found the magic set of command line options to cause it to eliminate all of the "extra" code it generates. Is there a way to eliminate this (presumably) extra code?
3. Both Eclipse and WSDL2Java seem to do a poor job of generating enums, though this seems to be a well-documented issue. Looking at JIRA, this seems to be fixed - any timeframe on a release that includes proper enum support? (In the mean time, I'm wrapping the generated enums to make them look like they should).
Eclipse 3.4 (Ganymede) w/Axis2 1.4 (I think)
Axis2 1.4 and 1.4.1 (tried both)
BTW, my code works, so these are mostly logistical/efficiency issues, though I haven't yet tried the WSDL2Java-generated code.
Many thanks...
-- Bill