[SoapRMI] [SPAM:# 51%] =?iso-8859-1?Q?writing_a_(de)serializer?=
nodep@libero.it
nodep_at_libero.it
Thu, 28 Nov 2002 21:29:57 +0100
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...))
I've updated SoapEnc.java with:
// handler for Mex
MexHandler mexHandler= new MexHandler();
SoapEnc.getDefault().registerClassEncodingHandler(
Mex.class,
mexHandler,
mexHandler);
(("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:sample'>
<sayHello 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.
Can you help me?
Thanks!
Stefano Pedon
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...)