You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Ted Liefeld <li...@broad.mit.edu> on 2006/11/22 13:18:55 UTC

Axis 1.2->1.4 migration help needed

We are upgrading an old web service based on Axis 1.2 to 1.4 so that we 
can start using Java5 (way belatedly) and I am having problems with the 
deserialization of a HashMap.  This always worked easily in 1.1 and 1.2 
but not in axis 1.3 or 1.4.

The error is this;
SEVERE: Could not convert [Lorg.apache.xml.xml_soap.MapItem; to bean 
field 'attributes', type java.util.HashMap

Basically it seems that the MapDeserializer is not doing its thing and 
is trying to set the array of MapItems into a slot that is supposed to 
have a deserialized HashMap.

======== the setup ==============
Basically, I have a class that inherits from HashMap (TaskInfoAttributes 
extends HashMap).  The typemapping is registered in the wsdd file as 
follows;

  <typeMapping 
deserializer="org.apache.axis.encoding.ser.MapDeserializerFactory" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
qname="ns7:TaskInfoAttributes" 
serializer="org.apache.axis.encoding.ser.MapSerializerFactory" 
type="java:java.util.HashMap" xmlns:ns7="TaskIntegrator"/>

When I generate the stub from the WSDL (wsdl2j), the server shows this 
warning;

2006-11-22 07:12:36.815 The class 
org.genepattern.webservice.TaskInfoAttributes
extends non-bean class java.util.HashMap.  An xml schema anyType will be 
used to  define org.genepattern.webservice.TaskInfoAttributes in the 
wsdl file.

Now I compile the stub and try to call a method that returns another 
object holding on to one of these TaskInfoAttribute/HashMap objects and 
I see the following error;

  Nov 22, 2006 6:58:08 AM 
org.apache.axis.encoding.ser.BeanPropertyTarget set
  SEVERE: Could not convert [Lorg.apache.xml.xml_soap.MapItem; to bean 
field 'attributes', type java.util.HashMap
  Nov 22, 2006 6:58:08 AM org.apache.axis.client.Call invoke
  SEVERE: Exception:
  java.lang.IllegalArgumentException: argument type mismatch
      at 
org.apache.axis.encoding.ser.BeanPropertyTarget.set(BeanPropertyTarget.java:157)
      at 
org.apache.axis.encoding.DeserializerImpl.valueComplete(DeserializerImpl.java:249)

=============================================================

So has anybody sucessfully gotten a Map class to serialize/deserialize 
that would be willing to explain to me where I have gone wrong?

Thanks

Ted

-- 
Ted Liefeld                          | Voice:      (617) 252-1069
Cancer Genomics Informatics          | Front desk: (617) 252-1900
Broad Institute                      | Fax:        (617) 258 0903
7 Cambridge Center                   | Email: liefeld@broad.mit.edu
Cambridge, MA 02142                  | http://www.broad.mit.edu/cancer


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org