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 xuliujuan <xu...@hotmail.com> on 2004/02/24 02:15:10 UTC

Is therer any way to get the soap body before sending it out ?

Hi all,

          The Axis serialization framework is  not  tightly controlled to be part of the SOAP envelope only.
a.. I have tested it using  the codes below     

  MessageContext msgContext0 = new MessageContext(new AxisServer());

  Writer stringWriter = new StringWriter();  SerializationContext context0 = new SerializationContextImpl(stringWriter0, msgContext0);  QName qq0=instance of java bean.getClass().getTypeDesc().getXmlType();  BeanSerializer theBeanSe=(BeanSerializer)a Java bean instance.getClass().getSerializer("", instance of java bean.getClass(),qq0);  theBeanSe.serialize(qq0,null, instance of java bean ,context0);  stringWriter0.close();  String s=stringWriter.toString();  System.out.println(s); 
 But I can't get the SoapEnvelope using  context0 getCurrentMessage().getSoapEnvelop().  It is null.

Could you kindly to tell me how to get the SOAP Envelope before it is being sent out?

Thanks ^_^
/XuLiujuan