You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Michele Mazzucco <Mi...@ncl.ac.uk> on 2006/06/28 15:32:16 UTC

[Axis2] How to add header info to the response message

Hi all,

is it possible to add some informations into the (response) SOAP header
from the service side (I'm assuming the operation to be out-in)? In
other words, given the echo() operation, can the service add some data
into the (outgoing) soap header (please note that in this scenario no
ServiceClient nor OperationClient are created)?


Thanks,
Michele

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


Re: [Axis2] How to add header info to the response message

Posted by Eran Chinthaka <ch...@opensource.lk>.
Michele Mazzucco wrote:
> Hi Eran,
> 
> yes, I need to add some headers from the service and I'm using
> RawXMLINOutMessageReceiver. Should it work if I do it into
> setOperationContext() when
> msgCtx = opctx.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE)
> is not null (i.e. the message is going out)? Or do I need a handler?

I always prefer if you handle SOAP headers with handlers.

I just checked the code and it seems you can not add headers within your
service impl class, as RawXMLINOutMessageReceiver calls the impl method,
gets the result and always adds that to the body of the out going message.

The only option to do this is to add a handler, which is the case it
should be.

-- Chinthaka


Re: [Axis2] How to add header info to the response message

Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
Hi Eran,

yes, I need to add some headers from the service and I'm using
RawXMLINOutMessageReceiver. Should it work if I do it into
setOperationContext() when
msgCtx = opctx.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE)
is not null (i.e. the message is going out)? Or do I need a handler?


Thanks,
Michele

Eran Chinthaka wrote:
> Michele Mazzucco wrote:
>> Hi all,
>>
>> is it possible to add some informations into the (response) SOAP header
>> from the service side (I'm assuming the operation to be out-in)? In
>> other words, given the echo() operation, can the service add some data
>> into the (outgoing) soap header (please note that in this scenario no
>> ServiceClient nor OperationClient are created)?
> 
> IIUC, you wanna add some headers from the service itself?
> 
> Which message receiver are you using? Is it a custom message receiver
> you got after code gen or a built in one from Axis2?
> 
> - Chinthaka
> 

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


Re: [Axis2] How to add header info to the response message

Posted by Eran Chinthaka <ch...@opensource.lk>.
Michele Mazzucco wrote:
> Hi all,
> 
> is it possible to add some informations into the (response) SOAP header
> from the service side (I'm assuming the operation to be out-in)? In
> other words, given the echo() operation, can the service add some data
> into the (outgoing) soap header (please note that in this scenario no
> ServiceClient nor OperationClient are created)?

IIUC, you wanna add some headers from the service itself?

Which message receiver are you using? Is it a custom message receiver
you got after code gen or a built in one from Axis2?

- Chinthaka