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:[email protected]]
Envoyé : 24 avril 2013 00:47
À : [email protected]; [email protected]
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>