You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by marcello <m....@storming.it> on 2007/09/05 12:24:10 UTC

handler: manipulating messages with DOM

I'm trying to manipulate a response message using DOM on Axis 1.1, but I'm
not sure about the flow I should follow.

I've tried the following:

Message response = msgContext.getResponseMessage();
SOAPEnvelope responseEnvelope = response.getSOAPEnvelope();
SOAPBodyElement sbe = (SOAPBodyElement) responseEnvelope.getFirstBody();
doc = sbe.getAsDOM();
... manipulate doc
responseEnvelope.removeBodyElement(sbe);
SOAPBodyElement newBody = new SOAPBodyElement(doc.getDocumentElement());
responseEnvelope.addBodyElement(newBody);

As a test, I've tried to run the code above without doing any modification
to the DOM document, just to see if it gave me the result I expected (a
modified message identical to the original), but it didn't. I get an invalid
message which brings to a casting exception in the following phases.

What I'm I doing wrong?

Thanks in advance.

Marcello Desantis
Storming Sas

-- 
View this message in context: http://www.nabble.com/handler%3A-manipulating-messages-with-DOM-tf4383141.html#a12494998
Sent from the Axis - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org