Hi,

The DOM stuff is really aimed for server side processing.
As a client its not currently the way to go.

I can only infer from your original email that you are indeed a client.

Based on the helpful response from Tom I will post something later (when I
get to home) that allows you to set the
SOAP body as a XML doc (as-is) on post and obtain the XML Document 'as-is'
after receive, without disrupting/upsetting the
existing SOAP handler. (largely thru copying code, its not ideal, but it
gets work done)

regards
Wayne

On 25/03/07, jmdev <[EMAIL PROTECTED]> wrote:


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