You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Ken Pelletier <ke...@nika.com> on 2005/01/29 18:23:41 UTC

Serializing/Deserializing elements outside of SOAP w/Axis

I have a somewhat unorthadox requirement to be able to 
serialize/deserialize elements to/from xml within an Axis client, but 
outside of the context of a SOAP message.

The service is doc-literal and the Axis client code is generated from 
wsdl/schema.

I'd like to be able to ser/des certain java objects using the 
underlying Axis ser/des machinery outside of the context of a SOAP 
message, and do so in a way that will adapt as the schema changes.

I will ser an object that was part of a SOAP response in order to 
process the xml and then des that xml back to an object (or graph of 
objects) in order to make another SOAP request to store.  (yes, it 
seems crazy, but there is a specific need for this tool)

The steps would be:

SOAP call to retrieve
     Serialize a particular object from the response back into its xml 
representation
         ... app-specific processing of the xml ...
     Deserialize that xml back into it's Java representation.
SOAP call using that object

With my initial research into Axis' ser/des mechanism, I can see how I 
might do serialization, but it would require that I hand-code a lot of 
things that are gen'd into the stubs and would break if the schema 
changes.

Deserialization (afaik) relies on a set of stacked sax handlers with 
the SOAP envelope at the top to kick it off.  It isn't apparent to me 
how to get at the des for a single object w/o the message context.

Has anybody been down this road before?