axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Thome <mth...@bbn.com>
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,
                              Query.getTypeDesc().getXmlType());
       xr.setContentHandler((ContentHandler) des);
       xr.parse(new InputSource(fr));
       Query q = (Query) des.getValue();
       XMLUtils.releaseSAXParser(parser);
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)

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


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message