You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Fabio souza <fa...@gmail.com> on 2011/02/12 14:36:04 UTC

Sending a message ID

Hi,

I'm building some monitoring interceptors to evaluate my Web Services, so
I'd like to "mark" some messages on the client-side using an Id and recover
that Id on the server-side in order to build a correlation. How can I send
contextual informal (like that Id) from the client to the server side? The
solution that I found was to use a client-side interceptor to put it on a
SOAP header and other interceptor (on the server side) to read it. Is there
some other way like a built-in context? What if I have a Restful service?

Thank you, very much!

-- 
Fábio

Re: Sending a message ID

Posted by Fabio souza <fa...@gmail.com>.
Ok, Willen,

Thank you again for your promptness!

Best regards,

Fabio

On Mon, Feb 14, 2011 at 8:53 AM, Willem Jiang <wi...@gmail.com>wrote:

> On 2/14/11 11:48 AM, Fabio souza wrote:
>
>> Hi Willen,
>>
>> First of all, thank you very much for your answer! Let me try to be more
>> explicit about my doubt... Each CXF interceptor has a handleMessage method
>> with a Message parameter on which it can put some data using put method,
>> for
>> example. Well, that data will be promptly available to the other
>> interceptors on the chain so that they can easily get them. However, that
>> information will not be sent throughout the network, for example, from the
>> client to the server (unless I plug an interceptor that explicitly adds
>> that
>> information to a SOAP header).  Am I right?
>>
>
> Yes, you are right.
>
>  The same thing applies to the
>
>> data that is put on the Exchange.
>>
>
> Why do you want to store the properties in to exchange?
> Exchange is used to correlate the in, out message, the exchange will not be
> marshalled or unmarshalled across the network.
>
>
> In this case, the difference that I could
>
>> see is that the data that is stored on the Exchange is also available to
>> the
>> interceptors on the reverse direction (on the same side).
>>
>
> You already got it :)
>
>
>
>> Thank you, very much again!
>>
>> Best regards,
>>
>> Fábio
>>
>> On Sun, Feb 13, 2011 at 11:30 PM, Willem Jiang<willem.jiang@gmail.com
>> >wrote:
>>
>>  Hi,
>>>
>>> I think the CXF ws-rm module has this kind of mechanism. but it may be a
>>> litter complicated.
>>> If you are using JAXWS handler[1], it should be easy to implement it
>>> yourself.
>>> [1]http://jax-ws.java.net/articles/handlers_introduction.html
>>>
>>>
>>> On 2/12/11 9:36 PM, Fabio souza wrote:
>>>
>>>  Hi,
>>>>
>>>> I'm building some monitoring interceptors to evaluate my Web Services,
>>>> so
>>>> I'd like to "mark" some messages on the client-side using an Id and
>>>> recover
>>>> that Id on the server-side in order to build a correlation. How can I
>>>> send
>>>> contextual informal (like that Id) from the client to the server side?
>>>> The
>>>> solution that I found was to use a client-side interceptor to put it on
>>>> a
>>>> SOAP header and other interceptor (on the server side) to read it. Is
>>>> there
>>>> some other way like a built-in context? What if I have a Restful
>>>> service?
>>>>
>>>> Thank you, very much!
>>>>
>>>>
>>>>
>>> --
>>> Willem
>>> ----------------------------------
>>> FuseSource
>>> Web: http://www.fusesource.com
>>> Blog:    http://willemjiang.blogspot.com (English)
>>>         http://jnn.javaeye.com (Chinese)
>>> Twitter: willemjiang
>>>
>>>
>>
>>
>>
>
> --
> Willem
> ----------------------------------
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.com (English)
>         http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
>



-- 
Fábio

Re: Sending a message ID

Posted by Willem Jiang <wi...@gmail.com>.
On 2/14/11 11:48 AM, Fabio souza wrote:
> Hi Willen,
>
> First of all, thank you very much for your answer! Let me try to be more
> explicit about my doubt... Each CXF interceptor has a handleMessage method
> with a Message parameter on which it can put some data using put method, for
> example. Well, that data will be promptly available to the other
> interceptors on the chain so that they can easily get them. However, that
> information will not be sent throughout the network, for example, from the
> client to the server (unless I plug an interceptor that explicitly adds that
> information to a SOAP header).  Am I right?

Yes, you are right.
  The same thing applies to the
> data that is put on the Exchange.

Why do you want to store the properties in to exchange?
Exchange is used to correlate the in, out message, the exchange will not 
be marshalled or unmarshalled across the network.

In this case, the difference that I could
> see is that the data that is stored on the Exchange is also available to the
> interceptors on the reverse direction (on the same side).

You already got it :)

>
> Thank you, very much again!
>
> Best regards,
>
> Fábio
>
> On Sun, Feb 13, 2011 at 11:30 PM, Willem Jiang<wi...@gmail.com>wrote:
>
>> Hi,
>>
>> I think the CXF ws-rm module has this kind of mechanism. but it may be a
>> litter complicated.
>> If you are using JAXWS handler[1], it should be easy to implement it
>> yourself.
>> [1]http://jax-ws.java.net/articles/handlers_introduction.html
>>
>>
>> On 2/12/11 9:36 PM, Fabio souza wrote:
>>
>>> Hi,
>>>
>>> I'm building some monitoring interceptors to evaluate my Web Services, so
>>> I'd like to "mark" some messages on the client-side using an Id and
>>> recover
>>> that Id on the server-side in order to build a correlation. How can I send
>>> contextual informal (like that Id) from the client to the server side? The
>>> solution that I found was to use a client-side interceptor to put it on a
>>> SOAP header and other interceptor (on the server side) to read it. Is
>>> there
>>> some other way like a built-in context? What if I have a Restful service?
>>>
>>> Thank you, very much!
>>>
>>>
>>
>> --
>> Willem
>> ----------------------------------
>> FuseSource
>> Web: http://www.fusesource.com
>> Blog:    http://willemjiang.blogspot.com (English)
>>          http://jnn.javaeye.com (Chinese)
>> Twitter: willemjiang
>>
>
>
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Re: Sending a message ID

Posted by Fabio souza <fa...@gmail.com>.
Hi Willen,

First of all, thank you very much for your answer! Let me try to be more
explicit about my doubt... Each CXF interceptor has a handleMessage method
with a Message parameter on which it can put some data using put method, for
example. Well, that data will be promptly available to the other
interceptors on the chain so that they can easily get them. However, that
information will not be sent throughout the network, for example, from the
client to the server (unless I plug an interceptor that explicitly adds that
information to a SOAP header). Am I right? The same thing applies to the
data that is put on the Exchange. In this case, the difference that I could
see is that the data that is stored on the Exchange is also available to the
interceptors on the reverse direction (on the same side).

Thank you, very much again!

Best regards,

Fábio

On Sun, Feb 13, 2011 at 11:30 PM, Willem Jiang <wi...@gmail.com>wrote:

> Hi,
>
> I think the CXF ws-rm module has this kind of mechanism. but it may be a
> litter complicated.
> If you are using JAXWS handler[1], it should be easy to implement it
> yourself.
> [1]http://jax-ws.java.net/articles/handlers_introduction.html
>
>
> On 2/12/11 9:36 PM, Fabio souza wrote:
>
>> Hi,
>>
>> I'm building some monitoring interceptors to evaluate my Web Services, so
>> I'd like to "mark" some messages on the client-side using an Id and
>> recover
>> that Id on the server-side in order to build a correlation. How can I send
>> contextual informal (like that Id) from the client to the server side? The
>> solution that I found was to use a client-side interceptor to put it on a
>> SOAP header and other interceptor (on the server side) to read it. Is
>> there
>> some other way like a built-in context? What if I have a Restful service?
>>
>> Thank you, very much!
>>
>>
>
> --
> Willem
> ----------------------------------
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.com (English)
>         http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
>



-- 
Fábio

Re: Sending a message ID

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

I think the CXF ws-rm module has this kind of mechanism. but it may be a 
litter complicated.
If you are using JAXWS handler[1], it should be easy to implement it 
yourself.
[1]http://jax-ws.java.net/articles/handlers_introduction.html

On 2/12/11 9:36 PM, Fabio souza wrote:
> Hi,
>
> I'm building some monitoring interceptors to evaluate my Web Services, so
> I'd like to "mark" some messages on the client-side using an Id and recover
> that Id on the server-side in order to build a correlation. How can I send
> contextual informal (like that Id) from the client to the server side? The
> solution that I found was to use a client-side interceptor to put it on a
> SOAP header and other interceptor (on the server side) to read it. Is there
> some other way like a built-in context? What if I have a Restful service?
>
> Thank you, very much!
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang