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 Ken Weiner <kw...@interactivebusiness.com> on 2002/05/08 03:40:27 UTC

Need Help: Deserializer for Cookie object

I am writing an RPC service that includes the javax.servlet.http.Cookie
object as one of the method arguments.  I can't use a
BeanSerializer/Deserializer because the Cookie object doesn't have a
no-argument constructor.  I assume this means that I need to make my own
Serializer and Deserializer.  I have figured out how to make a
serializer that produces:

<cookie>
   <name xsi:type="xsd:string">myCookieName</name>
   <value xsi:type="xsd:string">myCookieValue</value>
   <comment xsi:type="xsd:string">myComment</comment>
   <domain xsi:type="xsd:string">mydomain</domain>
   <maxAge xsi:type="xsd:int">123</maxAge>
   <path xsi:type="xsd:string">myPath</path>
   <secure xsi:type="xsd:boolean">true</secure>
   <version xsi:type="xsd:int">1</version>
</cookie>

But I can't figure out how to write a proper Deserializer.  I have
extended DeserializerImpl, but what do I do in the onStartElement and
onStartChild methods?

Does anyone have example code for a custom Deserializer implementation?
The ones that come with Axis haven't been of any help to me.  I have
already looked at the encoding sample that comes with Axis and that
didn't help either.

Thanks for any help you can offer.

-Ken