To get a TreeMap or HashMap to serialize using MapSerializer, you can either
register the MapSerializer for those types, or specify the parameter as
having a Java type of Map, e.g.

    TreeMap myMap;
    Vector params = new Vector();
    params.addElement(new Parameter("myMap", Map.class, myMap, null));

Scott Nichol

----- Original Message -----
From: "Niclas Hedhman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 01, 2002 9:22 PM
Subject: Re: Confusing issue on Maps


> On Monday 01 July 2002 23:15, Scott Nichol wrote:
> > Niclas,
> >
> > Have you written and executed code that is giving you an error, or are
you
> > just raising the issue based on reading code?  Chris is quite correct
about
> > serialization, and that should work just fine.  I am concerned about
> > de-serialization, though, since it appears you will get back a
Hashtable,
> > which is not compatible with, e.g., a HashMap as a method parameter.
So,
> > if you are getting an error executing code, please post it to this list
or
> > Bugzilla so we can have a look at it.
>
> Ok, I agree I looked thorugh the code a bit hasty, but it was triggered by
an
> exception saying that there was no serializer available for
> java.util.TreeMap, and changing the type to java.util.HashMap, just
replaced
> the exception with such a message instead.
>
> So, what I did yesterday was to implement my own MapSerializer, by using
the
> HashtableSerializer code, declare it in SOAPMappingRegistry and in the
> deployment descriptor, and that works. Is it that I have to explicitly
> declare the org.apache.soap.encoding.soapencoding.MapSerializer?
>
>
> I'll regenerat the exception in a moment.
>
> Stay tuned.
>
> Niclas
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to