[SoapRMI] [SPAM:# 51%] =?iso-8859-1?Q?Re:_[SoapRMI]_writing_a_(de)serializer?=

nodep@libero.it nodep_at_libero.it
Fri, 29 Nov 2002 23:44:06 +0100


> "nodep_at_libero.it" wrote:
> 
> > Hi,
> > I'm trying to write a (de)serializer for a
> > class "Mex", but I've problem with the
> > method "writeObject". It's like this:
> > public void writeObject(
> >         SerializeContext sctx,
> >         EncodingStyle enc,
> >         Object o,
> >         String name,
> >         Class baseClass,
> >         String id)
> >         throws SerializeException, XmlMapException, IOException
> >     {
> >         Writer out = sctx.getWriter();
> >         out.write('<');
> >         out.write(name);
> >         SoapStyle style = sctx.getSoapStyle();
> >         if(style.XSI_TYPED) sctx.writeXsdType("xmlMex");
> >         out.write('>');
> >
> >         String s="TRY";
> >         out.write(s);
> >         out.write("</");
> >         out.write(name);
> >         out.write(">\n");
> >     }
> >
> > ((it does nothing special but I want to see if it run...))
> 
> hi,
> 
> it looks OK.
> 
> > I've updated SoapEnc.java with:
> > // handler for Mex
> >         MexHandler mexHandler= new MexHandler();
> >         SoapEnc.getDefault().registerClassEncodingHandler(
> >         Mex.class,
> >         mexHandler,
> >         mexHandler);
> 
> you actually should call this from your class unless you want Mex
> handler to be part of XSOAP.
> 
> > (("MexHandler" is my (de)serializer I placed in xsoap_1_2_19
> > \src\java\soaprmi\soap\soaprmi\soapenc
> >   with the new SoapEnc.java))
> > After compilation (no error), I tried to send a "Mex"-object
> > but nothing usefull was in the soap-message (i.e. the "TRY" string 
was
> > not present), that is:
> > <SOAP-ENV:Envelope xmlns:SOAP-
> > ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:SOAP-
> > ENC='http://schemas.xmlsoap.org/soap/encoding/'
> > xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance'
> > xmlns:xsd='http://www.w3.org/1999/XMLSchema' SOAP-
> > ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
> >
> > <SOAP-ENV:Body>
> > <m:sayHello xmlns:m='urn:hello:
id='id1' xsi:type='ns1:minimal.Mex' 
xmlns:ns1='urn:soaprmi-
> > v11:temp-java-xml-type'>
> > </sayHello>
> > </m:sayHello>
> >
> > </SOAP-ENV:Body>
> > </SOAP-ENV:Envelope>
> >
> > Same result I have if I use an untouched xsoap_1_2_19.jar and I 
send
> > a "Mex"-object.
> 
> how do you send your object and more importantly what exactly is Mex 
class?
> 
> if you send me Mex.java and MexHandler.java and your test class
> i will try to reproduce the problem.
> 
> > PS-Now I'm able to compile xsoap because I use xsoap_1_2_19_all.zip
> > instead of *.gzip (I don't know why...)
> 
> i have downloaded 
http://www.extreme.indiana.edu/xgws/xsoap/rmi/download/
> xsoap_1_2_19_all.tgz and successfully recompiled on solaris and 
windows 2000
> and rebuilt without any problems (on windows i have used WinZip to 
unpack .tgz)
> 
> i am still curious what is causing this problem for you.
> 
> thanks,
> 
> alek
> --
> The ancestor of every action is a thought. - Ralph Waldo Emerson
> 
----------------------------------------------------------------------
Hi,
I send you the code. Basically I've modified 
the "minimal" sample. I placed Mex.java, MexHandler.java, 
SoapEnc.java in: src\java\soaprmi\soap\soaprmi\soapenc
and I used command "build all" to rebuild xsoap.
Question: where should I to call "SoapEnc" for to enable
my serializer?
I hope you can to help me.
Thank you.

Stefano Pedon