Title: Message
There is a NameValueCollection in .NET which it would seem would be perfect for storing a HashMap where you want to have string values stored under string keys.
If that's what you really want.
 
You might need to work out how to insert the (de)-serialisation of the Axis HashMap generation into the .NET Web Service.
 
Fear not, though, there are interceptors that can be inserted into the .NET Web Service processing chain through configuration.
 
Hope This Helps,
 
Patrick
 
 
 
 
 
-----Original Message-----
From: Pritesh Damani [mailto:[EMAIL PROTECTED]
Sent: 18 January 2005 16:56
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: serializer for hashmap

Thanks for answering,
 
Can you elaborate more on the issues you pointed out.
From this I understand is that if I have some simple dataTypes in the HashMap for eg. int as key and String as value, would it work ?
and when you said "write your own", I do not understand what do I have to write.  Would the following code work ? I doubt it ? Please guide me in my approach. All I want right now is to convert my hashmap into 2 arrays, one with the keys and other with the values
 

public void serialize(QName name, Attributes attributes,

Object value, SerializationContext context)

throws IOException

{

if (!(value instanceof HashMap))

throw new IOException("Can't serialize a " +

value.getClass().getName() + " with a DataSerializer.");

HashMap map = (HashMap)value;

context.startElement(name, attributes);

context.serialize(new QName("", MAP), null, map);

context.endElement();

}

Thank You Once again,
 
Pritesh
--
All Computers wait at the same speed !!
 


From: Michael Oliver [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 18, 2005 11:46 AM
To: [EMAIL PROTECTED]
Subject: RE: serializer for hashmap

The problem is not so much the serialization of the Hashmap or Hashtable as it is the objects within them.

 

The JavaBean Encode and Decode will create XML to/from a JavaBean with a getter and setter for a Hashmap or Hashtable, but if there is an object stored in the Hashmap or Hashtable that is not serializable also with the JavaBean Encode/Decode methods then you are scrod and you must write your own.

 

Michael Oliver

CTO

Alarius Systems LLC

3325 N. Nellis Blvd, #1

Las Vegas, NV 89115

Phone:(702)643-7425

Fax:(520)844-1036

*Note new email changed from [EMAIL PROTECTED]

-----Original Message-----
From: Pritesh Damani [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 18, 2005 8:37 AM
To:
[EMAIL PROTECTED]
Subject: serializer for hashmap

 

hello everyone,

 

has anyone successfully written a custome serializer for hashmap object so that it could be understood by .net ??

I mean, I was seeing the encoding example provided but that is only for some basic Object types I think, correct me if I am wrong.

 

Please help me with this.,

 

Pritesh

 

--

All Computers wait at the same speed !!

 

Reply via email to