You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by kurt-apache-cxf <ku...@hestonsystems.com> on 2013/04/24 05:59:39 UTC

Microsoft XSD files causing MANY name collisions

I'm getting a "Two declarations cause a collision in the ObjectFactory 
class" error.

Every one of the XSD files exposed by the DotNet webservice I'm trying 
to connect with has multiple name collisions.  The one below is simplest 
of the them.

Is there a simple config/fix to remedy this?   Or, do I need to go in 
and create an xpath statement to find each of them in a binding file 
(there are 843 total duplicates in 6 XSD files)?

<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" 
targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" 
xmlns:xs="http://www.w3.org/2001/XMLSchema" 
xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
     <xs:complexType name="ArrayOfstring">
         <xs:sequence>
             <xs:element minOccurs="0" maxOccurs="unbounded" 
name="string" nillable="true" type="xs:string"/>
         </xs:sequence>
     </xs:complexType>
     <xs:element name="ArrayOfstring" nillable="true" 
type="tns:ArrayOfstring"/>
</xs:schema>


Re: Microsoft XSD files causing MANY name collisions

Posted by kurt-apache-cxf <ku...@hestonsystems.com>.
Daniel,

Running xjc worked the first time I tried.  No errors.  I'm guessing I 
need to add more parameters to make it a closer analog to what I'm doing 
with wsdl2java?  Not sure yet.  Here are the commands I've tried with 
each (eclipse WTP gen'd on the wsdl2java side):

wsdl2java -client -d C:\<output dir>\.cxftmp/src -classdir C:\<output 
dir>\build\classes -p http://tempuri.org/=org.tempuri 
-autoNameResolution -impl -validate -exsh false -dns true -dex true 
-wsdlLocation <output dir>/svc/Integration.svc?wsdl -verbose 
-defaultValues -fe jaxws -db jaxb -wv 1.1 <output 
dir>/svc/Integration.svc?wsdl > out2.txt 2>&1 (result: 4338 lines of 
ugly output)

xjc "<output dir>\svc\Integration.svc@xsd=xsd5" (result: no complaints)

Great suggestion to use xjc!  Still at it...

On 4/26/2013 7:42 AM, Daniel Kulp wrote:
> On Apr 26, 2013, at 2:58 AM, kurt-apache-cxf <ku...@hestonsystems.com> wrote:
>
>> The error output from wsdl2java is confusing, hence my question about the number of errors.
>>
>> Notice in the example XSD I included earlier in this thread there are exactly 2 instances of the string "ArrayOfstring."  For some reason, wsdl2java is throwing two errors calling out ArrayOfstring as a duplicate.  Shouldn't just the second one be a duplicate?  Is it me that is confused or the tool?
> What version of CXF are you using?   Definitely make sure you are using a relatively recent version.     That may help some of the error messages.
>
>
>> I've implemented David's example for each of the 6 XSD files included in my WSDL.  I've confirmed the xpath statements are finding nodes (because if I change them, the tool complains), but the suffix doesn't appear to be getting added (because my error count hasn't changed).
> You might want to try doing a single xsd at a time using the JDK's xic tool and pass in the same jaxb binding file. (I'd suggest the JDK 1.7 for this)   It may spit out different error messages that might be a bit more useful.  When the binding file works for that xsd, then start passing that into the CXF wsdl2java tool.
>
> Dan
>
>
>
>> What am I missing?
>>
>> On 4/25/2013 9:29 PM, kurt-apache-cxf wrote:
>>> David,
>>>
>>> Thanks for the examples, I'm attempting to tweak them to work for me.  Curious, how many collisions did wsdl2java report before you fixed your issues with these particular files?
>>>
>>> On 4/24/2013 5:13 AM, Gagnon, David wrote:
>>>> I run into the same problem and I fixed it with:
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <jxb:bindings version="2.0"
>>>>                xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
>>>>                xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
>>>>          >
>>>>      <jxb:bindings schemaLocation="Microsoft1.xsd">
>>>>          <jxb:globalBindings generateElementProperty="false">
>>>>              <xjc:simple/>
>>>>          </jxb:globalBindings>
>>>>      </jxb:bindings>
>>>>
>>>> </jxb:bindings>
>>>>
>>>>
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <jxb:bindings version="2.0"
>>>>                xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
>>>>                xmlns:xs="http://www.w3.org/2001/XMLSchema">
>>>>
>>>>      <jxb:globalBindings>
>>>>          <jxb:serializable uid="1"/>
>>>>      </jxb:globalBindings>
>>>>      <jxb:bindings schemaLocation="schemas1.xsd">
>>>>          <jxb:bindings node=".//xs:element" multiple="true">
>>>>              <jxb:nameXmlTransform>
>>>>                  <jxb:elementName suffix="Element"/>
>>>>              </jxb:nameXmlTransform>
>>>>          </jxb:bindings>
>>>>      </jxb:bindings>
>>>>
>>>>
>>>> </jxb:bindings>
>>>>
>>>> Hope it`s help
>>>> David
>>>>
>>>> -----Message d'origine-----
>>>> De : Freeman Fang [mailto:freeman.fang@gmail.com]
>>>> Envoyé : 24 avril 2013 00:47
>>>> À : users@cxf.apache.org; kurt-apache-cxf@hestonsystems.com
>>>> Objet : Re: Microsoft XSD files causing MANY name collisions
>>>>
>>>> yep, using jaxb binding file to specify the unique name is the way to go
>>>> -------------
>>>> Freeman(Yue) Fang
>>>>
>>>> Red Hat, Inc.
>>>> FuseSource is now part of Red Hat
>>>> Web: http://fusesource.com | http://www.redhat.com/
>>>> Twitter: freemanfang
>>>> Blog: http://freemanfang.blogspot.com
>>>> http://blog.sina.com.cn/u/1473905042
>>>> weibo: @Freeman小屋
>>>>
>>>> On 2013-4-24, at 上午11:59, kurt-apache-cxf wrote:
>>>>
>>>>> I'm getting a "Two declarations cause a collision in the ObjectFactory class" error.
>>>>>
>>>>> Every one of the XSD files exposed by the DotNet webservice I'm trying to connect with has multiple name collisions.  The one below is simplest of the them.
>>>>>
>>>>> Is there a simple config/fix to remedy this?   Or, do I need to go in and create an xpath statement to find each of them in a binding file (there are 843 total duplicates in 6 XSD files)?
>>>>>
>>>>> <?xml version="1.0" encoding="utf-8"?> <xs:schema
>>>>> elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
>>>>>     <xs:complexType name="ArrayOfstring">
>>>>>         <xs:sequence>
>>>>>             <xs:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="xs:string"/>
>>>>>         </xs:sequence>
>>>>>     </xs:complexType>
>>>>>     <xs:element name="ArrayOfstring" nillable="true"
>>>>> type="tns:ArrayOfstring"/> </xs:schema>
>>>>>


Re: Microsoft XSD files causing MANY name collisions

Posted by Daniel Kulp <dk...@apache.org>.
On Apr 26, 2013, at 2:58 AM, kurt-apache-cxf <ku...@hestonsystems.com> wrote:

> The error output from wsdl2java is confusing, hence my question about the number of errors.
> 
> Notice in the example XSD I included earlier in this thread there are exactly 2 instances of the string "ArrayOfstring."  For some reason, wsdl2java is throwing two errors calling out ArrayOfstring as a duplicate.  Shouldn't just the second one be a duplicate?  Is it me that is confused or the tool?

What version of CXF are you using?   Definitely make sure you are using a relatively recent version.     That may help some of the error messages.


> I've implemented David's example for each of the 6 XSD files included in my WSDL.  I've confirmed the xpath statements are finding nodes (because if I change them, the tool complains), but the suffix doesn't appear to be getting added (because my error count hasn't changed).

You might want to try doing a single xsd at a time using the JDK's xic tool and pass in the same jaxb binding file. (I'd suggest the JDK 1.7 for this)   It may spit out different error messages that might be a bit more useful.  When the binding file works for that xsd, then start passing that into the CXF wsdl2java tool.

Dan



> 
> What am I missing?
> 
> On 4/25/2013 9:29 PM, kurt-apache-cxf wrote:
>> David,
>> 
>> Thanks for the examples, I'm attempting to tweak them to work for me.  Curious, how many collisions did wsdl2java report before you fixed your issues with these particular files?
>> 
>> On 4/24/2013 5:13 AM, Gagnon, David wrote:
>>> I run into the same problem and I fixed it with:
>>> 
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <jxb:bindings version="2.0"
>>>               xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
>>>               xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
>>>         >
>>>     <jxb:bindings schemaLocation="Microsoft1.xsd">
>>>         <jxb:globalBindings generateElementProperty="false">
>>>             <xjc:simple/>
>>>         </jxb:globalBindings>
>>>     </jxb:bindings>
>>> 
>>> </jxb:bindings>
>>> 
>>> 
>>> 
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <jxb:bindings version="2.0"
>>>               xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
>>>               xmlns:xs="http://www.w3.org/2001/XMLSchema">
>>> 
>>>     <jxb:globalBindings>
>>>         <jxb:serializable uid="1"/>
>>>     </jxb:globalBindings>
>>>     <jxb:bindings schemaLocation="schemas1.xsd">
>>>         <jxb:bindings node=".//xs:element" multiple="true">
>>>             <jxb:nameXmlTransform>
>>>                 <jxb:elementName suffix="Element"/>
>>>             </jxb:nameXmlTransform>
>>>         </jxb:bindings>
>>>     </jxb:bindings>
>>> 
>>> 
>>> </jxb:bindings>
>>> 
>>> Hope it`s help
>>> David
>>> 
>>> -----Message d'origine-----
>>> De : Freeman Fang [mailto:freeman.fang@gmail.com]
>>> Envoyé : 24 avril 2013 00:47
>>> À : users@cxf.apache.org; kurt-apache-cxf@hestonsystems.com
>>> Objet : Re: Microsoft XSD files causing MANY name collisions
>>> 
>>> yep, using jaxb binding file to specify the unique name is the way to go
>>> -------------
>>> Freeman(Yue) Fang
>>> 
>>> Red Hat, Inc.
>>> FuseSource is now part of Red Hat
>>> Web: http://fusesource.com | http://www.redhat.com/
>>> Twitter: freemanfang
>>> Blog: http://freemanfang.blogspot.com
>>> http://blog.sina.com.cn/u/1473905042
>>> weibo: @Freeman小屋
>>> 
>>> On 2013-4-24, at 上午11:59, kurt-apache-cxf wrote:
>>> 
>>>> I'm getting a "Two declarations cause a collision in the ObjectFactory class" error.
>>>> 
>>>> Every one of the XSD files exposed by the DotNet webservice I'm trying to connect with has multiple name collisions.  The one below is simplest of the them.
>>>> 
>>>> Is there a simple config/fix to remedy this?   Or, do I need to go in and create an xpath statement to find each of them in a binding file (there are 843 total duplicates in 6 XSD files)?
>>>> 
>>>> <?xml version="1.0" encoding="utf-8"?> <xs:schema
>>>> elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
>>>>    <xs:complexType name="ArrayOfstring">
>>>>        <xs:sequence>
>>>>            <xs:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="xs:string"/>
>>>>        </xs:sequence>
>>>>    </xs:complexType>
>>>>    <xs:element name="ArrayOfstring" nillable="true"
>>>> type="tns:ArrayOfstring"/> </xs:schema>
>>>> 
> 

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: Microsoft XSD files causing MANY name collisions

Posted by kurt-apache-cxf <ku...@hestonsystems.com>.
The error output from wsdl2java is confusing, hence my question about 
the number of errors.

Notice in the example XSD I included earlier in this thread there are 
exactly 2 instances of the string "ArrayOfstring."  For some reason, 
wsdl2java is throwing two errors calling out ArrayOfstring as a 
duplicate.  Shouldn't just the second one be a duplicate?  Is it me that 
is confused or the tool?

I've implemented David's example for each of the 6 XSD files included in 
my WSDL.  I've confirmed the xpath statements are finding nodes (because 
if I change them, the tool complains), but the suffix doesn't appear to 
be getting added (because my error count hasn't changed).

What am I missing?

On 4/25/2013 9:29 PM, kurt-apache-cxf wrote:
> David,
>
> Thanks for the examples, I'm attempting to tweak them to work for me.  
> Curious, how many collisions did wsdl2java report before you fixed 
> your issues with these particular files?
>
> On 4/24/2013 5:13 AM, Gagnon, David wrote:
>> I run into the same problem and I fixed it with:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <jxb:bindings version="2.0"
>>                xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
>>                xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
>>          >
>>      <jxb:bindings schemaLocation="Microsoft1.xsd">
>>          <jxb:globalBindings generateElementProperty="false">
>>              <xjc:simple/>
>>          </jxb:globalBindings>
>>      </jxb:bindings>
>>
>> </jxb:bindings>
>>
>>
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <jxb:bindings version="2.0"
>>                xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
>>                xmlns:xs="http://www.w3.org/2001/XMLSchema">
>>
>>      <jxb:globalBindings>
>>          <jxb:serializable uid="1"/>
>>      </jxb:globalBindings>
>>      <jxb:bindings schemaLocation="schemas1.xsd">
>>          <jxb:bindings node=".//xs:element" multiple="true">
>>              <jxb:nameXmlTransform>
>>                  <jxb:elementName suffix="Element"/>
>>              </jxb:nameXmlTransform>
>>          </jxb:bindings>
>>      </jxb:bindings>
>>
>>
>> </jxb:bindings>
>>
>> Hope it`s help
>> David
>>
>> -----Message d'origine-----
>> De : Freeman Fang [mailto:freeman.fang@gmail.com]
>> Envoyé : 24 avril 2013 00:47
>> À : users@cxf.apache.org; kurt-apache-cxf@hestonsystems.com
>> Objet : Re: Microsoft XSD files causing MANY name collisions
>>
>> yep, using jaxb binding file to specify the unique name is the way to go
>> -------------
>> Freeman(Yue) Fang
>>
>> Red Hat, Inc.
>> FuseSource is now part of Red Hat
>> Web: http://fusesource.com | http://www.redhat.com/
>> Twitter: freemanfang
>> Blog: http://freemanfang.blogspot.com
>> http://blog.sina.com.cn/u/1473905042
>> weibo: @Freeman小屋
>>
>> On 2013-4-24, at 上午11:59, kurt-apache-cxf wrote:
>>
>>> I'm getting a "Two declarations cause a collision in the 
>>> ObjectFactory class" error.
>>>
>>> Every one of the XSD files exposed by the DotNet webservice I'm 
>>> trying to connect with has multiple name collisions.  The one below 
>>> is simplest of the them.
>>>
>>> Is there a simple config/fix to remedy this?   Or, do I need to go 
>>> in and create an xpath statement to find each of them in a binding 
>>> file (there are 843 total duplicates in 6 XSD files)?
>>>
>>> <?xml version="1.0" encoding="utf-8"?> <xs:schema
>>> elementFormDefault="qualified" 
>>> targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" 
>>> xmlns:xs="http://www.w3.org/2001/XMLSchema" 
>>> xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
>>>     <xs:complexType name="ArrayOfstring">
>>>         <xs:sequence>
>>>             <xs:element minOccurs="0" maxOccurs="unbounded" 
>>> name="string" nillable="true" type="xs:string"/>
>>>         </xs:sequence>
>>>     </xs:complexType>
>>>     <xs:element name="ArrayOfstring" nillable="true"
>>> type="tns:ArrayOfstring"/> </xs:schema>
>>>


Re: Microsoft XSD files causing MANY name collisions

Posted by kurt-apache-cxf <ku...@hestonsystems.com>.
David,

Thanks for the examples, I'm attempting to tweak them to work for me.  
Curious, how many collisions did wsdl2java report before you fixed your 
issues with these particular files?

On 4/24/2013 5:13 AM, Gagnon, David wrote:
> I run into the same problem and I fixed it with:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <jxb:bindings version="2.0"
>                xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
>                xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
>          >
>      <jxb:bindings schemaLocation="Microsoft1.xsd">
>          <jxb:globalBindings generateElementProperty="false">
>              <xjc:simple/>
>          </jxb:globalBindings>
>      </jxb:bindings>
>
> </jxb:bindings>
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <jxb:bindings version="2.0"
>                xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
>                xmlns:xs="http://www.w3.org/2001/XMLSchema">
>
>      <jxb:globalBindings>
>          <jxb:serializable uid="1"/>
>      </jxb:globalBindings>
>      <jxb:bindings schemaLocation="schemas1.xsd">
>          <jxb:bindings node=".//xs:element" multiple="true">
>              <jxb:nameXmlTransform>
>                  <jxb:elementName suffix="Element"/>
>              </jxb:nameXmlTransform>
>          </jxb:bindings>
>      </jxb:bindings>
>
>
> </jxb:bindings>
>
> Hope it`s help
> David
>
> -----Message d'origine-----
> De : Freeman Fang [mailto:freeman.fang@gmail.com]
> Envoyé : 24 avril 2013 00:47
> À : users@cxf.apache.org; kurt-apache-cxf@hestonsystems.com
> Objet : Re: Microsoft XSD files causing MANY name collisions
>
> yep, using jaxb binding file to specify the unique name is the way to go
> -------------
> Freeman(Yue) Fang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://fusesource.com | http://www.redhat.com/
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
> http://blog.sina.com.cn/u/1473905042
> weibo: @Freeman小屋
>
> On 2013-4-24, at 上午11:59, kurt-apache-cxf wrote:
>
>> I'm getting a "Two declarations cause a collision in the ObjectFactory class" error.
>>
>> Every one of the XSD files exposed by the DotNet webservice I'm trying to connect with has multiple name collisions.  The one below is simplest of the them.
>>
>> Is there a simple config/fix to remedy this?   Or, do I need to go in and create an xpath statement to find each of them in a binding file (there are 843 total duplicates in 6 XSD files)?
>>
>> <?xml version="1.0" encoding="utf-8"?> <xs:schema
>> elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
>>     <xs:complexType name="ArrayOfstring">
>>         <xs:sequence>
>>             <xs:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="xs:string"/>
>>         </xs:sequence>
>>     </xs:complexType>
>>     <xs:element name="ArrayOfstring" nillable="true"
>> type="tns:ArrayOfstring"/> </xs:schema>
>>


RE: Microsoft XSD files causing MANY name collisions

Posted by "Gagnon, David" <Da...@iaah.ca>.
I run into the same problem and I fixed it with:

<?xml version="1.0" encoding="UTF-8"?>
<jxb:bindings version="2.0"
              xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
              xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
        >
    <jxb:bindings schemaLocation="Microsoft1.xsd">
        <jxb:globalBindings generateElementProperty="false">
            <xjc:simple/>
        </jxb:globalBindings>
    </jxb:bindings>

</jxb:bindings>



<?xml version="1.0" encoding="UTF-8"?>
<jxb:bindings version="2.0"
              xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
              xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <jxb:globalBindings>
        <jxb:serializable uid="1"/>
    </jxb:globalBindings>
    <jxb:bindings schemaLocation="schemas1.xsd">
        <jxb:bindings node=".//xs:element" multiple="true">
            <jxb:nameXmlTransform>
                <jxb:elementName suffix="Element"/>
            </jxb:nameXmlTransform>
        </jxb:bindings>
    </jxb:bindings>


</jxb:bindings>

Hope it`s help
David

-----Message d'origine-----
De : Freeman Fang [mailto:freeman.fang@gmail.com] 
Envoyé : 24 avril 2013 00:47
À : users@cxf.apache.org; kurt-apache-cxf@hestonsystems.com
Objet : Re: Microsoft XSD files causing MANY name collisions

yep, using jaxb binding file to specify the unique name is the way to go
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

On 2013-4-24, at 上午11:59, kurt-apache-cxf wrote:

> I'm getting a "Two declarations cause a collision in the ObjectFactory class" error.
> 
> Every one of the XSD files exposed by the DotNet webservice I'm trying to connect with has multiple name collisions.  The one below is simplest of the them.
> 
> Is there a simple config/fix to remedy this?   Or, do I need to go in and create an xpath statement to find each of them in a binding file (there are 843 total duplicates in 6 XSD files)?
> 
> <?xml version="1.0" encoding="utf-8"?> <xs:schema 
> elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
>    <xs:complexType name="ArrayOfstring">
>        <xs:sequence>
>            <xs:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="xs:string"/>
>        </xs:sequence>
>    </xs:complexType>
>    <xs:element name="ArrayOfstring" nillable="true" 
> type="tns:ArrayOfstring"/> </xs:schema>
> 


Re: Microsoft XSD files causing MANY name collisions

Posted by Freeman Fang <fr...@gmail.com>.
yep, using jaxb binding file to specify the unique name is the way to go
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

On 2013-4-24, at 上午11:59, kurt-apache-cxf wrote:

> I'm getting a "Two declarations cause a collision in the ObjectFactory class" error.
> 
> Every one of the XSD files exposed by the DotNet webservice I'm trying to connect with has multiple name collisions.  The one below is simplest of the them.
> 
> Is there a simple config/fix to remedy this?   Or, do I need to go in and create an xpath statement to find each of them in a binding file (there are 843 total duplicates in 6 XSD files)?
> 
> <?xml version="1.0" encoding="utf-8"?>
> <xs:schema elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
>    <xs:complexType name="ArrayOfstring">
>        <xs:sequence>
>            <xs:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="xs:string"/>
>        </xs:sequence>
>    </xs:complexType>
>    <xs:element name="ArrayOfstring" nillable="true" type="tns:ArrayOfstring"/>
> </xs:schema>
>