You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Daniel Kulp <dk...@apache.org> on 2009/12/04 17:55:33 UTC

Re: WSDL2Java with -allowElementReferences with cxf 2.2.x

On Thu November 19 2009 8:06:36 pm Shannon Hastings wrote:
> When in run wsdl to java on a wsdl doc using references in the message
>  where the message uses the same data type twice, ie to create a method
>  that looks like foo(Bar arg1, Bar arg2) I get the following error from
>  wsdlToJava:

Well, jaxws doesn't really allow us to automatically change/increment names 
when doing wsdl2java.   If there is a conflict, you're supposed to use a 
binding file to remap the name.

That said, we have a -autoNameResolution flag that can also be passed to 
automatically do the name increment thing.   That may work for this case.

Another thing you could try is:

  <element ref="introduce-ns0:Service" minOccurs="2" maxOccurs="2"/>

That would generate as  a List<Service>, but would probably work.

Dan


> WSDLToJava Error: Element {http://org.cagrid.introduce/2/Services}Service
> has Having the same name with different types[null -- null],  In wrapper
> style, there is a collision as per the spec.
> 
> I do not get there error if I only have one ref of the Bar type.  Below is
> the snippit of wsdl that causes this error (note: the element test uses the
> introduce-ns0:Service  type twice which seems to be ok with spec and I
>  would expect it to create the method test(Service arg1, Service arg2) ).
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions name="TTTesting" targetNamespace="http://testing.org"
>     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:tns="http://testing.org"
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:addr="http://www.w3.org/2001/XMLSchema"
>     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:introduce-ns0="http://org.cagrid.introduce/2/Services">
>     <wsdl:types>
>         <schema xmlns="http://www.w3.org/2001/XMLSchema"
> xmlns:wsa="http://www.w3.org/2005/08/addressing"
>             elementFormDefault="qualified"
> targetNamespace="http://testing.org">
>             <import namespace="http://org.cagrid.introduce/2/Services"
>                 schemaLocation="./Services.xsd" />
> 
>             <element name="test">
>                 <complexType>
>                     <sequence>
>                         <element ref="introduce-ns0:Service" />
>                         <element ref="introduce-ns0:Service" />
>                     </sequence>
>                 </complexType>
>             </element>
>             <element name="testResponse">
>                 <complexType>
>                     <sequence>
>                         <element ref="introduce-ns0:Service" />
>                     </sequence>
>                 </complexType>
>             </element>
>         </schema>
>     </wsdl:types>
>     <wsdl:message name="test">
>         <wsdl:part name="parameters" element="tns:test">
>         </wsdl:part>
>     </wsdl:message>
>     <wsdl:message name="test_ResourceFrameworkOptions">
>         <wsdl:part name="fault"
> element="introduce-ns0:ResourceFrameworkOptions">
>         </wsdl:part>
>     </wsdl:message>
>     <wsdl:message name="testResponse">
>         <wsdl:part name="parameters" element="tns:testResponse">
>         </wsdl:part>
>     </wsdl:message>
> 

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