XuLiujuan,

 

            In this example, I’m getting the complete SOAP envelope as a string from the MessageContext.  Hope this helps:

 

      public void invoke(MessageContext msg) throws AxisFault

      {

            Message request = msg.getRequestMessage();

            logger.info("CruiseAPI Request: " + request.getSOAPPartAsString());

      }

 

Bill Heitzeg

 

-----Original Message-----
From: xuliujuan [mailto:[EMAIL PROTECTED]
Sent: Monday, February 23, 2004 8:15 PM
To: [EMAIL PROTECTED]
Subject: 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.

·  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

Reply via email to