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 "Thomas Bevan (JIRA)" <ax...@ws.apache.org> on 2006/02/06 06:56:24 UTC

[jira] Created: (AXIS-2395) WSDL2Java generates faulty code in cases where an attribute is defined as a list of enumerated types

WSDL2Java generates faulty code in cases where an attribute is defined as a list of enumerated types
----------------------------------------------------------------------------------------------------

         Key: AXIS-2395
         URL: http://issues.apache.org/jira/browse/AXIS-2395
     Project: Apache Axis
        Type: Bug
  Components: WSDL processing  
    Versions: 1.3    
 Environment: Windows XP
    Reporter: Thomas Bevan


I get the following Java exception when I run Axis client code to call a remote method returning a data-type 
of the sort described above. 

The actual data-type in question is defined below at thebottom of the message.

Axis works properly when the enumerate type is not part of a list.


 AxisFault
  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
  faultSubcode:
  faultString: java.lang.ClassCastException: org.apache.axis.encoding.ser.EnumDeserializer
  faultActor:
  faultNode:
  faultDetail:
     {http://xml.apache.org/axis/}stackTrace:java.lang.ClassCastException: org.apache.axis.encoding.ser.EnumDeserializer

     at org.apache.axis.encoding.ser.SimpleListDeserializerFactory.getDeserializerAs(SimpleListDeserializerFactory.java:78)
     at org.apache.axis.encoding.DeserializationContext.getDeserializer(DeserializationContext.java:464)
     at org.apache.axis.encoding.DeserializationContext.getDeserializerForType(DeserializationContext.java:547
     at org.apache.axis.encoding.ser.BeanDeserializer.getDeserializer(BeanDeserializer.java:514)
     at org.apache.axis.encoding.ser.BeanDeserializer.onStartElement(BeanDeserializer.java:427)
     at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
     at org.apache.axis.encoding.ser.BeanDeserializer.startElement(BeanDeserializer.java:154)
     at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
     at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
     at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
     at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
     at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
     at org.apache.axis.client.Call.invoke(Call.java:2469)
     at org.apache.axis.client.Call.invoke(Call.java:2366)
     at org.apache.axis.client.Call.invoke(Call.java:1812)


The WSDL defines the following data structure;

<xs:simpleType name="AddressTypeType">
		<xs:annotation>
			<xs:documentation>Enumerates address types</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:enumeration value="Primary">
				<xs:annotation>
					<xs:documentation>Primary address</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="Mailing">
				<xs:annotation>
					<xs:documentation>Mailing address</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="Invoice">
				<xs:annotation>
					<xs:documentation>Invoice address</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
		</xs:restriction>
</xs:simpleType>	
	    
<xs:simpleType name="AddressTypeListType">
        <xs:list itemType="AddressTypeType"/>
</xs:simpleType>
    
<xs:complexType name="TypedAUAddressType">
        <xs:complexContent>
        <xs:extension base="AUAddressType">
            <xs:attribute name="type" use="required" type="AddressTypeListType"/>
        </xs:extension>
        </xs:complexContent>
</xs:complexType>
    

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira