Hi!

The whole thing can be much simplified if you want the SOAPEnvelope (not only the body of it) in the current context (request or response):

void invoke(MessageContext msgContext)
{
   try
   {
      org.apache.axis.Message testMsg = context.getCurrentMessage();
      org.w3c.Element element = testMsg.getSOAPEnvelope().getAsDOM();
   }
   catch ( Exception ex )
   {
      throw new AxisFault("could not get body.");
   }
...
}


regards, Christoph

Christoph Tratter wrote:

Hi Valerie!

You can try something like this:
In the method invoke of your handler (as it extends BasicHandler) you have the following signature:


void invoke(MessageContext msgContext)

So you can try something like:

void invoke(MessageContext msgContext)
{
   org.apache.axis.Message testMsg = context.getRequestMessage();
   //Or ResponseMessage if getPastPivot() is true

   org.apache.axis.SOAPPart soapPart;
   soapPart = (org.apache.axis.SOAPPart)testMsg.getSOAPPart();
   try
   {
      org.apache.axis.message.SOAPBody body;
      body = (org.apache.axis.message.SOAPBody)
         soapPart.getAsSOAPEnvelope().getBody();
      org.w3c.Element element = body.getAsDOM();
      //or: org.w3c.Document doc = body.getAsDocument();
   }
   catch ( Exception ex )
   {
      throw new AxisFault("could not get body.");
   }
...
}





Reply via email to