You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by ma...@brunner-sr.de on 2008/09/22 15:51:11 UTC

WSDL2JAVA problem

Hi,

I try to generate client cod with wsdl2java. I get an exception thrown
by JAXB: Two declarations cause a collision in the ObjectFactory class.

Here is the snippet from the wsdl:

<s:complexType name="DocumentInfo">
<s:sequence>
...
   <s:element minOccurs="0" maxOccurs="1" name="_directory"
type="s:string"/>
   <s:element minOccurs="0" maxOccurs="1" name="Directory" 
type="s:string"/>
...
</s:sequence>
</s:complexType>

Does anybody know a solution? (Axis handles this without exceptions)

Thanks




Re: WSDL2JAVA problem

Posted by Daniel Kulp <dk...@apache.org>.

This is a JAXB issue, not really a CXF issue.    JAXB does provide some 
customization things to control this.   If you create a "customize.jxb" file 
with the contents:
<jaxb:bindings version="2.0"
      xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      
node="//xsd:complexType[@name='DocumentInfo']/xsd:sequence/xsd:element[@name='_directory']">

	<jaxb:property  name="underDirectory"/>
</jaxb:bindings>


and pass that into wsdl2java with the -b flag, it should work by renaming the 
property.

Dan


On Monday 22 September 2008 9:51:11 am mail@brunner-sr.de wrote:
> Hi,
>
> I try to generate client cod with wsdl2java. I get an exception thrown
> by JAXB: Two declarations cause a collision in the ObjectFactory class.
>
> Here is the snippet from the wsdl:
>
> <s:complexType name="DocumentInfo">
> <s:sequence>
> ...
>    <s:element minOccurs="0" maxOccurs="1" name="_directory"
> type="s:string"/>
>    <s:element minOccurs="0" maxOccurs="1" name="Directory"
> type="s:string"/>
> ...
> </s:sequence>
> </s:complexType>
>
> Does anybody know a solution? (Axis handles this without exceptions)
>
> Thanks



-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog