cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Diephouse <...@envoisolutions.com>
Subject Re: ComplexTypes
Date Fri, 13 Oct 2006 15:53:48 GMT
Shaw, Richard A wrote:

> I've just tried my software with CXF to see if the complex type issues 
> I was seeing a few weeks ago are fixed and I think the answer is sort of….
>
> I've added a new operation to the hello world sample which has a 
> complex type in the return. It takes a name and returns the first and 
> second name by splitting the input string at the space character.
>
> If my response is defined as per the commented out section below then 
> I get an error. If I define it using a named type (the example below 
> the commented out section) then it is ok.
>
> <element name="splitName">
> <complexType>
> <sequence>
> <element name="name" type="string"/>
> </sequence>
> </complexType>
> </element>
> <!-- <element name="splitNameResponse">
> <complexType>
> <sequence>
> <element name="names">
> <complexType>
> <sequence>
> <element name="first" type="string"/>
> <element name="second" type="string"/>
> </sequence>
> </complexType>
> </element>
> </sequence>
> </complexType>
> </element> -->
> <complexType name="names">
> <sequence>
> <element name="first" type="string"/>
> <element name="second" type="string"/>
> </sequence>
> </complexType>
> <element name="splitNameResponse">
> <complexType>
> <sequence>
> <element name="names" type="tns:names"/>
> </sequence>
> </complexType>
> </element>
>
> This is cause by the following rule from WSDLServiceBuilder.class
>
> // If this is an anonymous complex type, mark it as unwrapped.
> // We're doing this because things like JAXB don't have support
> // for finding classes from anonymous type names.
> if (el.getSchemaTypeName() == null && el.getRefName() == null) {
> return false;
> }
>
> I don't believe this is true because Celtix was quite happy to use 
> JAXB with anonymous complex types.
>
> If this restriction must apply in CXF then we wont be using it, the 
> amount of work to change our WSDL definitions to always use types will 
> be too prohibitive.
>
I see what you're saying. This code is actually an artifact from XFire 
and arose from times when there was no @Request/ResponseWrapper 
annotation. I think we can take this out for now as we always generate 
the wrappers with WSDL first code (XFire didn't use too, because it 
started before JAX-WS...).

> Note: The other issue I had was with arrays of complex types being 
> returned. This works as long as I name all my types as above.
>
I got the JAXB people to provide some insight on how to get the 
ArrayLists to serialize. I have to finish the client fault handling, but 
as soon as I do that I can make these changes for you...

- Dan

-- 
Dan Diephouse
(616) 971-2053
Envoi Solutions LLC
http://netzooid.com


Mime
View raw message