WSDLServiceBuilder generates sourceURIs that are odd numbered instead of
sequential for multiple inline schema elements in WSDL
-------------------------------------------------------------------------------------------------------------------------------
Key: XFIRE-1137
URL: http://jira.codehaus.org/browse/XFIRE-1137
Project: XFire
Issue Type: Bug
Components: Core
Affects Versions: 1.2.6
Reporter: Omkar Patil
Assignee: Dan Diephouse
Fix For: 1.2.7
Attachments: fix.patch
I observed this problem while working with a WSDL that was provided to me (that
I cannot change) and generating static client using wsgen task. The WSDL
contains multiple inline schema elements, one each for a namespace. I used jaxb
binding and needed to customize it by using an external binding file to change
the package structure of generated classes. My binding files looked like this -
<jxb:bindings version="2.0"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jxb:globalBindings generateElementProperty="false" />
<jxb:bindings schemaLocation="HelloService.wsdl#types?schema1"
node="/xs:schema">
<jxb:schemaBindings>
<jxb:package name="pojo.client.test.com" />
</jxb:schemaBindings>
</jxb:bindings>
<jxb:bindings schemaLocation="HelloService.wsdl#types?schema2"
node="/xs:schema">
<jxb:schemaBindings>
<jxb:package name="client.test.com" />
</jxb:schemaBindings>
</jxb:bindings>
<jxb:bindings schemaLocation="HelloService.wsdl#types?schema3"
node="/xs:schema">
<jxb:schemaBindings>
<jxb:package name="client.pojo.test.com" />
</jxb:schemaBindings>
</jxb:bindings>
.
.
.
.
</jxb:bindings>
Based on the XFire documentation, I assumed that the SourceURIs generated for
each schema element in the WSDL would be
types?schema1
types?schema2
types?schema3
.
.
And therefore I constructed the bindings files as shown above. But the wsgen
task failed with the following exception -
Feb 10, 2009 2:44:59 PM org.codehaus.xfire.gen.jaxb.ErrorReceiverImpl error
SEVERE:
"file:/D:/omkar/oswb/workspaces-ganymede/my_os/xfire-ws-client/src/main/resources/config/HelloService.wsdl#types?schema2"
is not a part of this compilation.
Is this a mistake for
"file:/D:/omkar/oswb/workspaces-ganymede/my_os/xfire-ws-client/src/main/resources/config/HelloService.wsdl#types?schema1"?
at 10,90 in file:/D:
/omkar/oswb/workspaces-ganymede/my_os/xfire-ws-client/src/main/resources/config/bindings.xml
Therefore, while peeking under the hood while debugging, I found that the
protected void visit(String location, Types types) method of WSDLServiceBuilder
class increments the schemaCount twice for each schema while iterating on
XmlSchemaCollection, resulting in odd numbered SourceURI's for schemas as
follows -
types?schema1
types?schema3
types?schema5
.
.
Resulting in exception mentioned above. This needs to be changed to generate
sequential sourceURIs for multiple inline schemas in WSDL.
I have created a patch that provides fix for WSDLServiceBuilder to generate
sequential sourceURIs, a test that parses a WSDL with multiple inline schema
elements and asserts that the sourceURIs generated are sequential.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email