Re: How to write an own Serializer? Or is any Serializer for a bean available?
Michael Yuan <[email protected]> Fri, 31 Jan 2003 10:08:03 -0600 (CST)
| Newsgroups | gmane.comp.java.enhydra.ksoap |
|---|---|
| Message-ID | <[email protected]> |
Take a look at my JavaWorld article: http://www.javaworld.com/javaworld/jw-08-2002/jw-0823-wireless.html I discussed custom (de)serializer near the end of the article. My article was discussing kSOAP v1.2, however. I would suggest you to work on a new serializer for kSOAP v2.0. I believe it has a slightly different structure. kSOAP v2.0 is still in development but it already works OK with many SOAP services I tested ... :) Also, SOAP arrays are deserialized into Vector objects in kSOAP. cheers Michael ---------------------------------------------------------------------------- Read Michael Yuan's technology articles http://www.enterprisej2me.com/articles.php Dr. Dobbs Journal, JavaWorld, IBM developerWorks and more ... ---------------------------------------------------------------------------- On Fri, 31 Jan 2003, Hans Kaiser wrote: > > > Apache SOAP has a nice Serializer, the BeanSerializer. Is an > > BeanSerializer > > > also under kSOAP available? > > > If not, how could I implement my own one? > > > Is there any example Code available? > > > > For CLDC environments, it is not possible to create a BeanSerializer > > because > > of the missing reflection capabilities. However, for CDC and J2SE, I think > > it would be great to have one. I was planning to add one to kSOAP 2, but > > till now, I did not find the time. > > Sure, I searched for a CDC BeanSerializer. Maybe I will give it a try this > weekend, to implement a BeanSerializer. > Have I to consider something, before getting started? > > > Building your own Bean serializer should be possible based on the > > Marshal interface. > > > > However, it would still be necessary to register all classes > > to be (de)serialized with the SoapSerializationEnvelope in > > order to inform kSOAP about the correct mapping between XML > > namespaces and names and Java class names using the addMapping > > method of SoapSerializationEnvelope. > > I believe I haven't got it! > How do I register the BeanSerializer? Via ClassMap? > Could you give me some samplecode? > > > Best, > > Stefan > > -- > +++ GMX - Mail, Messaging & more http://www.gmx.net +++ > NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen! > > _______________________________________________ > Ksoap mailing list > [email protected] > http://www.enhydra.org/mailman/listinfo.cgi/ksoap >