axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Tratter <trat...@dbai.tuwien.ac.at>
Subject Re: SOAP to DOM
Date Tue, 09 Dec 2003 15:20:11 GMT
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.");
    }
...
}


regards,
Christoph

valerie.bauche@bull.net wrote:
> In a handler (axis BasicHandler type), I need to transform the soap part of
> the message into a Document object
> I use the javax.xml.transform.Transformer and I get the Document object.
> But this Document is full of "\n" and sometimes "\r" or spaces !!!
> It's not very easy to use : is there any solution to get a "clean" Document
> object with only the meaningful elements of the SOAPPart ?
> 
> Valerie
> 
> 


Mime
View raw message