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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to