I think I figured out how to change the SOAP Body.

Digging through DOMSerializer I noticed that it is looking for the
DOMOutHandler.DOM_MESSAGE property.  By setting this property in my handler,
I was able to change what was sent over the wire.

i.e.
context.getOutMessage().setProperty(DOMOutHandler.DOM_MESSAGE, document);

I am thinking the two references to the body that I need to change are

context.getOutMessage().setProperty(DOMOutHandler.DOM_MESSAGE, document);
context.getOutMessage().setBody(new Object[] {new DOMSource(node)});

Sound about right?


jmdev wrote:
> 
> I am probably making a simple mistake, but I want to change the SOAP Body
> in my handler and am having trouble doing so.
> 
> Executing the following fragment seems to alter the internal
> representation of the OutMessage within the call, but the SOAP which gets
> sent over the wire is unaltered.  Could someone shed light on why this
> isn't working and suggest what I need to do to be able to change the soap
> body.
> 
> Element helloWorldElement = new Element("HelloWorldElement");
> Document helloWorldDocument = new Document(helloWorldElement);
> 
> ...
> 
> DOMOutputter outputter = new DOMOutputter();
> org.w3c.dom.Document document = outputter.output(helloWorldDocument);
> org.w3c.dom.Node node = document.getDocumentElement();      
>       
> context.getOutMessage().setBody(new Object[] {new DOMSource(node)});
> 
> Thanks in advance!
> 

-- 
View this message in context: 
http://www.nabble.com/Can%27t-Change-SOAP-Body-in-Handler--tf3460967.html#a9663665
Sent from the XFire - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to