users@glassfish.java.net

WS: Logicalhandler setPayload doesn't work

From: <glassfish_at_javadesktop.org>
Date: Fri, 01 Feb 2008 10:13:13 PST

I have a LogicalHandler for my WS where I am trying to set the Message PayLoad as follows. But the setPayLoad method doesn't seem to have any impact. The original payload is being returned to the client. Am I doing anything wrong here?

public boolean handleMessage(LogicalMessageContext context) {
LogicalMessage msg = context.getMessage();
Boolean outboundProperty = (Boolean)
context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);

if (outboundProperty)
{
out.println("Outbound message:");
LogicalMessage lm = context.getMessage();
Source payload = lm.getPayload();

Source pLoad = new StreamSource(new StringReader(_payLoad));
lm.setPayload(pLoad);

}
else
{
out.println("Inbound message:");
}
return true;
}
[Message sent by forum member 'i_srini' (i_srini)]

http://forums.java.net/jive/thread.jspa?messageID=257046