History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: XFIRE-819
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dan Diephouse
Reporter: Eric Miles
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
XFire

WsGen and anonymous complexTypes with an xsd:choice not generating appropriately

Created: 28/Dec/06 01:26 PM   Updated: 06/Jan/07 09:15 AM
Component/s: Generator
Affects Version/s: 1.2.3
Fix Version/s: 1.2.4

Time Tracking:
Not Specified

File Attachments: 1. XML File WeatherService.wsdl (5 kb)

Environment: Linux Fedora Core 6 on Intel based PC, Sun JDK 1.5.0_10, Tomcat 5.5.20, Maven 2.0.4


 Description  « Hide
When I have an anonymous complexType defined on a Jaxb2 service elemnt with an xsd:choice indicator, the WsGen task generates clients without parameters. For example, if I take the WeatherService example provided in the distribution and run WsGen on it, the resulting interface has the appropriate in parameters on the web method. Below are the relevant code snippets:

xsd:
<xsd:element name="GetWeatherByZipCode">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="1" name="ZipCode" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

generated interface:
@WebMethod(operationName = "GetWeatherByZipCode", action = "")
@WebResult(name = "GetWeatherByZipCodeResult", targetNamespace = "http://www.webservicex.net")
public WeatherForecastsType getWeatherByZipCode(
@WebParam(name = "ZipCode", targetNamespace = "http://www.webservicex.net")
String ZipCode);

However, if I add an xsd:choice to the above XSD for the GetWeatherByZipCode element and run WsGen, I get NO parameters for the resulting web method. See below for relevant code snippets:

xsd:
<xsd:element name="GetWeatherByZipCode">
<xsd:complexType>
<xsd:choice>
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="1" name="ZipCode" type="xsd:string"/>
</xsd:sequence>
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="1" name="TestZipCode" type="xsd:string"/>
</xsd:sequence>
</xsd:choice>
</xsd:complexType>
</xsd:element>

generated interface:
@WebMethod(operationName = "GetWeatherByZipCode", action = "")
@WebResult(name = "GetWeatherByZipCodeResult", targetNamespace = "http://www.webservicex.net")
public WeatherForecastsType getWeatherByZipCode();

Is this a bug with WsGen with an anonymous complexType?



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Dan Diephouse - 02/Jan/07 11:45 PM
Looks like a bug. Looking into it....

Dan Diephouse - 06/Jan/07 09:15 AM
Thanks Eric, I've fixed this in SVN now and it'll be included in our 1.2.4 release today.