You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Riggs, David" <dr...@asset.com> on 2002/08/06 20:46:19 UTC

Axis Chokes on Complex Types from MS Soap 3.0

I'm working with a MS Soap Toolkit 3.0 provider, they use an
auto-generated WSDL by MSSTK3 which defines a complex data
type and a method that returns an object of that type. The
data types are declared explicitly in the WSDL, eg:


------------- WSDL Excerpt ------------------
<complexType name="Mission">
	<sequence>
		<element name="MissionName" type="string" /> 
		<element name="MissionNumber" type="double" /> 
	</sequence>
</complexType>
----------------------------------------------


The actual SOAP envelope comes back with the following payload
(edited for clarity):


------------ SOAP-ENV Excerpt ----------------
<myns:Mission xmlns:myns="http://blah/TestWebService/type/"
xsi:type="myns:Mission">
	<MissionName>Some Mission Name</MissionName>
	<MissionNumber>42</MissionNumber> 
</myns:Mission>
----------------------------------------------


Using client side code generated from WSDL2Java, Axis fails
deserializing this Mission object with the fault:

   org.xml.sax.SAXException: Invalid element in blah.Mission -
MissionName

...aparantly Axis is expecting the data type to be explicitly
stated for these child elements(?) even though they have been
typed in the WSDL. I can make it work by modifying the following
line in the generated client side bean code (Mission.java):

   field.setXmlName(new
javax.xml.namespace.QName("http://blah/TestWebService/type/",
"MissionName"));

to look like this:

   field.setXmlName(new javax.xml.namespace.QName("MissionName"));


Should this be submitted as a bug report, or is there a 
workaround for this problem (I still havn't ruled out 
lack-of-understanding on my part yet)?

Thanks,

David A. Riggs
Science Applications International Corporation - SAIC
 (304)284-9000x201                  driggs@asset.com