axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marcello <m.desan...@storming.it>
Subject handler: manipulating messages with DOM
Date Sat, 01 Sep 2007 12:44:55 GMT

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-tf4364463.html#a12440052
Sent from the Axis - User mailing list archive at Nabble.com.


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


Mime
View raw message