axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andre Risnes" <Andre.Ris...@bbs.no>
Subject Why can't Axis find the deserializer for one of my classes?
Date Fri, 09 Jul 2004 09:41:27 GMT
Hi. I have a bunch of enum classes with custom serializers and deserializers.
One of these classes is called AccountCategory. When my SOAP client tries to
deserialize an instance of this class returned from my server, i get the
following exception:

AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: org.xml.sax.SAXException: No deserializer for {http://bbs.no/betalingsmotor/v2/domain/enum}AccountCategory
 faultActor: 
 faultNode: 
 faultDetail: 
	{http://xml.apache.org/axis/}stackTrace: org.xml.sax.SAXException: No deserializer for {http://bbs.no/betalingsmotor/v2/domain/enum}AccountCategory
	at org.apache.axis.encoding.DeserializerImpl.onStartElement(DeserializerImpl.java:485)
      [...]


The class is defined in my wsdd file like this:

<typeMapping qname="bbs:AccountCategory" xmlns:bbs="http://bbs.no/betalingsmotor/v2/domain/enum"
    languageSpecificType="java:no.bbs.betalingsmotor.v2.domain.enum.AccountCategory"
    serializer="no.bbs.betalingsmotor.axis.FieldEnumSerializerFactory"
    deserializer="no.bbs.betalingsmotor.axis.FieldEnumDeserializerFactory"
/>

Here is an example of a working definition for a different class:

<typeMapping qname="bbs:TransactionLevel" xmlns:bbs="http://bbs.no/betalingsmotor/v2/domain/enum"
    languageSpecificType="java:no.bbs.betalingsmotor.v2.domain.enum.TransactionLevel"
    serializer="no.bbs.betalingsmotor.axis.FieldEnumSerializerFactory"
    deserializer="no.bbs.betalingsmotor.axis.FieldEnumDeserializerFactory"
/>


When my client stub is generated, the AccountCategory class' code in the stub
file looks like this:

qName = new javax.xml.namespace.QName("http://bbs.no/betalingsmotor/v2/domain/enum", "AccountCategory");
cachedSerQNames.add(qName);
cls = no.bbs.betalingsmotor.v2.domain.enum.AccountCategory.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);

enumsf and enumdf are references to the .class members of the custom serializer
classes.

Here is an example of working code for a different class:

qName = new javax.xml.namespace.QName("http://bbs.no/betalingsmotor/v2/domain/enum", "TransactionLevel");
cachedSerQNames.add(qName);
cls = no.bbs.betalingsmotor.v2.domain.enum.TransactionLevel.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);


Here's an example of the SOAP xml code for a returned instance of 
AccountCategory:

<multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns3:AccountCategory" xmlns:ns3="http://bbs.no/betalingsmotor/v2/domain/enum" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">PRIVATE</multiRef>

Likewise, for the TransactionLevel class:

<multiRef id="id4" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns7:TransactionLevel" xmlns:ns7="http://bbs.no/betalingsmotor/v2/domain/enum" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">LEVEL_C_TRANSACTION</multiRef>


Looks identical all the way. So why can't Axis find the deserializer
for the AccountCategory class?


My Axis version is 1.1.

-- 
Regards
André Risnes

Mime
View raw message