cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shaw, Richard A" <richard.s...@atkinsglobal.com>
Subject ComplexTypes
Date Fri, 13 Oct 2006 14:28:28 GMT
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.

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.
 <<hello_world.wsdl>> 
Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Richard Shaw  
Technical Design Authority - Information Solutions Consultancy  
Intelligent Transport Systems 

Atkins Highways and Transportation 
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW

Tel: +44 (0) 1372 756407 
Fax: +44 (0) 1372 740055
Mob: 07740 817586 
E-mail: richard.shaw@atkinsglobal.com

www.atkinsglobal.com/its



This email and any attached files are confidential and copyright protected. If you are not
the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise
expressly agreed in writing, nothing stated in this communication shall be legally binding.

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message