The message context is available for the life of the request (according to the documentation). Therefore, you can call setProperty, on the message context, in any handler, to set a property that is available to any other handler, outbound or inbound. The current message context is passed to each handler but it can also be obtained by calling MessageContext.getCurrentContext(). I'm not quite sure when it's created, so it might need some experimentation to get hold of it in a client program (rather than a handler).
However, if access to this property is all on the client, then I'm sure that there are other ways to store values that code in the same VM can access.
Tony
"Rahul Tripathi"
<[EMAIL PROTECTED]>
17-Nov-2004 18:04 |
|
I have had a similar problem. My current fix (hack) is to use the
ApplicationSession
for passing data between the handler and the client code. Essentially, on your
service locator object, you call
locator.setMaintainSession(true);
Then, in the response handler, you can call
ctx.getAxisEngine().getApplicationSession().set(String name,
Object value);
and once control is passed back to the client, call
locator.getEngine().getApplicationSession.get(String name)
to get back your values.
I would also like to know if there is a better way of doing this.
Rahul
On Tue, 16 Nov 2004 22:30:21 -0500, James Chamberlain
<[EMAIL PROTECTED]> wrote:
> I have a question about client side response flow handlers. Is it
> possible for a client side response flow handler to add properties to
> the message context and have the client retrieve those properties?
> Seems basic, but it does not work for me. I have seen one other posting
> on the list about this, but no clear answer. I suspect that by the
> client gets the response that the context is gone and not available.
>
> This is important to me because I am chaining web services and would
> like properties in the message context to traverse the tiers.
>
> Can anyone confirm whether it is possible for a client response flow
> handler to add to the message context and have the client receive it?
>
> If it is not possible are there any best practices for accomplishing
> the same effect?
>
> Thanks,
>
> James
>
>