To clarify something: MapSerializer serializes and deserializes Maps.  On
the serializer side, this means you can serialize anything that implements
Map.  On the deserializer side, this means you get something that implements
a Map, but you have no control over the actual class.  So, you can use a
method like

    void setProperties(Map props)

in a service, but you cannot use

    void setProperties(HashMap props)

Also, if you have the following service method

    HashMap getProperties()

the client must treat the return value as a Map (not a HashMap).  If the
client wants a HashMap, the client must create it from the Map that is
returned.

Scott Nichol

----- Original Message -----
From: "Scott Nichol" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 01, 2002 11:15
Subject: Re: Confusing issue on Maps


> 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.
>
> Thanks.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Chris Francis" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, July 01, 2002 07:43
> Subject: RE: Confusing issue on Maps
>
>
> > Not quite, if the type is a Map then a new
> > Hashtable is created with the maps contents.
> > This hashtable is then serialized.
> > At least this is what happened in 2.2.
> >
> > -----Original Message-----
> > From: Niclas Hedhman [mailto:[EMAIL PROTECTED]]
> > Sent: 01 July 2002 06:21
> > To: [EMAIL PROTECTED]
> > Subject: Confusing issue on Maps
> >
> >
> >
> > I'm pretty new on SOAP, but now I have a need;
> >
> > If I read
> > http://xml.apache.org/soap/releases.html#v2.2
> > it says;
> >
> > "Added support for serializing/deserializing java.util.Maps."
> >
> > If I download
> > http://xml.apache.org/dist/soap/version-2.3.1/soap-src-2.3.1.tar.gz
> > and look at the file
> >
> > soap-2_3_1/src/org/apache/soap/encoding/soapenc/MapSerializer.java
> >
> > it delegates to HashtableSerializer.java
> >
> > which checks if the type is java.util.Hashtable
> >
> >
> > SO, Is it supported or not??
> >
> > If it is, then what am I supposed to do to get it to work?
> >
> > If it is not, then what is the claim in the documentation all about
then?
> >
> > 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]>
> >
> >
>
>
> --
> 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