Santana,
I'm looking for this answer too. And I'd also like to be able to use
the axis code to serialize as well. I've made some headway in
serialization with this code:
public static void writeQuery( QueryType qt ) throws Exception {
StringWriter o = new StringWriter();
MessageContext mctx = new MessageContext( new AxisClient() );
mctx.getAxisEngine().setOption( AxisEngine.PROP_SEND_XSI,
Boolean.FALSE );
mctx.setProperty( AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE );
mctx.setEncodingStyle(null);
SerializationContextImpl ctx = new SerializationContextImpl( o,
mctx );
ctx.setPretty(true);
Serializer s = QueryType.getSerializer( "", QueryType.class, new
QName("ecogrid://ecoinformatics.org/ecogrid-query-1.0.0beta1","query"));
s.serialize( new
QName("ecogrid://ecoinformatics.org/ecogrid-query-1.0.0beta1","query"),
null, qt, ctx);
System.out.println( o );
return ;
}
The QueryType is generated with WSDL2Java from one of the schemas
included by the wsdl.
This does not require any registration of the typemaps. I think to get
the deserialization working you do need to register typemaps. I've
attempted this but haven't made much headway.
Please post if you get any further.
Kevin
santana.beto wrote:
>Hi, I'm using axis to access an webservice. But I need to store the XMLs
>that my application exchanges.
>
>How can I use the same mechanism that Axis uses to deserialize objects and
>get the XML I'm sending and receiving.
>
>