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 Complex types in messages
Date Fri, 22 Sep 2006 01:15:22 GMT
I'm having trouble getting a complex type to be transferred.

The first problem I had was with arrays (<element name="sample" maxOccurs="unbounded">
this gives me an error in the JAXB classes saying that java.util.ArrayList is not recognised.

I then removed the maxOccurs="unbounded" so that it returns a single record but I now get
an error saying the my returned object is not the correct type - 

Exception in thread "main" java.util.IllegalFormatConversionException: d != com.atkinsglobal.mosaic.ftptransport.types.TestData$Sample
	at java.util.Formatter$FormatSpecifier.failConversion(Formatter.java:3978)

If I intercept the message stream it looks like this -

<TestData xmlns:ns2="http://www.w3.org/2005/08/addressing/wsdl" xmlns="http://www.atkinsglobal.com/mosaic/ftptransport/types"><a>1</a><b>2</b><c>3</c></TestData>

I was expecting it to look like the following (i.e. to include the sample element name) -

<TestData xmlns:ns2="http://www.w3.org/2005/08/addressing/wsdl" xmlns="http://www.atkinsglobal.com/mosaic/ftptransport/types"><sample><a>1</a><b>2</b><c>3</c></sample></TestData>

Could somebody tell me if this is a bug.

My WSDL is attached below (again! ).

Oh - I'm using the nightly build from the 21st.

Thanks

<?xml version="1.0" encoding="UTF-8"?>
<!--WSDL file template-->
<!--Created by IONA Artix Designer-->
<definitions name="ftptest.wsdl" 
	targetNamespace="http://www.atkinsglobal.com/mosaic/ftptransport"
	xmlns="http://schemas.xmlsoap.org/wsdl/" 
	xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
	xmlns:tns="http://www.atkinsglobal.com/mosaic/ftptransport"
	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
	xmlns:x1="http://www.atkinsglobal.com/mosaic/ftptransport/types"
	xmlns:xformat="http://cxf.apache.org/bindings/xformat"
	xmlns:ftp="http://cxf.apache.org/transports/ftp"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<types>
		<schema attributeFormDefault="unqualified" elementFormDefault="qualified"
			targetNamespace="http://www.atkinsglobal.com/mosaic/ftptransport/types" 
			xmlns="http://www.w3.org/2001/XMLSchema"
			xmlns:x1="http://www.atkinsglobal.com/mosaic/ftptransport/types" 
			xmlns:xs="http://www.w3.org/2001/XMLSchema">

			<element name="LoadTestData">
				<complexType>
					<sequence>
						<element name="x" type="xsd:int"/>
					</sequence>
				</complexType>
			</element>

			<element name="TestData">
				<complexType>
					<sequence>
<!--  						<element name="sample" maxOccurs="unbounded"> -->
 						<element name="sample">
							<complexType>
								<sequence>
									<element name="a" type="xsd:string" />
									<element name="b" type="xsd:string" />
									<element name="c" type="xsd:string" />
								</sequence>
							</complexType>
						</element>
					</sequence>
				</complexType>
			</element>

			<element name="TestDataFaultResponse">
				<complexType>
					<sequence>
						<element name="faultInfo" type="xsd:string" />
					</sequence>
				</complexType>
			</element>

		</schema>
	</types>

	<wsdl:message name="LoadTestData">
		<wsdl:part name="LoadTestData" element="x1:LoadTestData"></wsdl:part>
	</wsdl:message>
	<wsdl:message name="TestData">
		<wsdl:part name="TestData" element="x1:TestData"></wsdl:part>
	</wsdl:message>
	<wsdl:message name="TestDataFault">
		<wsdl:part name="TestDataFault" element="x1:TestDataFaultResponse"></wsdl:part>
	</wsdl:message>
	<portType name="LoadTestDataI">
		<operation name="LoadTestData">
			<input message="tns:LoadTestData" name="LoadTestData" />
			<output message="tns:TestData" name="TestData" />
			<fault message="tns:TestDataFault" name="TestDataFault" />
		</operation>
	</portType>

	<binding name="LoadTestDataISOAPBinding" type="tns:LoadTestDataI">
 		<xformat:binding/>
<!--		<soap:binding transport="http://schemas.xmlsoap.org/wsdl/http/"/> -->
		<operation name="LoadTestData">
<!-- 			<ftp:address location="file:///D:/cxf-deployment/workspace/FTPTransport/test/test.xml"
/ <ftp:address location=> > -->
			<input name="LoadTestData"></input>
			<output name="TestData"></output>
			<fault name="TestDataFault"></fault>
		</operation>
	</binding>

	<service name="LoadTestDataService">
		<port binding="tns:LoadTestDataISOAPBinding" name="LoadTestDataPort">
<!-- 			<ftp:address location="file:///D:/cxf-deployment/workspace/FTPTransport/test/fail.xml"
/ <ftp:address location=> > -->
			<soap:address location="http://localhost:81/LoadTestData"/>
		</port>
	</service>
</definitions>


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/alternative (inline, None, 0 bytes)
View raw message