axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Thome <>
Subject Using axis (wsdl2java-generated) datamodel for (de)serialization to files?
Date Mon, 28 Aug 2006 13:38:12 GMT
I've been trying to figure out how to serialize/deserialize axis beans 
to/from xml files - obviously all the pieces are there, but I haven't 
figured out quite how to connect them together.  Any suggestions would 
be most welcome.  My intent is to use squirreled-away fragments of 
webservice interactions as part of my unit test suite.

For instance, for deserialization, I was hoping that something like the 
following would work (where Query is a class generated by wsdl2java):
       FileReader fr = new FileReader(filename);
       SAXParser parser = XMLUtils.getSAXParser();
       XMLReader xr = parser.getXMLReader();
       Deserializer des = Query.getDeserializer("ignored", Query.class,
       xr.setContentHandler((ContentHandler) des);
       xr.parse(new InputSource(fr));
       Query q = (Query) des.getValue();
But, BeanDeserializer falls back on DefaultHandler's startElement 
(without a context argument) which is a no-op.

I'm just thrashing around at this point - I don't really want to 
serialize/deserialize the whole SOAP message (though I'll do it if I 
need to)

*Michael Thome*
BBN Technologies 10 Moulton St, Cambridge MA 02138 USA
phone: +1 617 873 1853

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message