-
1. Re: Adding application specific properties to the MessageCon
kellenheller Jan 16, 2008 1:15 PM (in response to kellenheller)I updated to v2.0.2.GA, but still the same issue - the custom properties are not retained when I set them in the client and try to get them in the handler or the service.
-
2. Re: Adding application specific properties to the MessageCon
yhrn Jan 16, 2008 4:54 PM (in response to kellenheller)Hi,
I'm not sure if I understand you correctly, but you cannot transfer properties from client to server this way. The properties you add to the client proxy request context can be read by client side handlers but they are not transferred to the server.
Regards,
Mattias -
3. Re: Adding application specific properties to the MessageCon
kellenheller Jan 16, 2008 6:21 PM (in response to kellenheller)I am trying to populate the properties in the client and read them in the server, either in the handler or in the service. I don't know what you mean by "transfer properties".
The docs say you can get the RequestContext from the BindingProvider, add properties all on the client, and then that is accessible via the MessageContext on the server.
But so far, no success :( -
4. Re: Adding application specific properties to the MessageCon
yhrn Jan 17, 2008 3:19 AM (in response to kellenheller)The docs say you can get the RequestContext from the BindingProvider, add properties all on the client, and then that is accessible via the MessageContext on the server.
In what document have you read that? The properties you set on a BindingProvider request context is used to initialize the client side message context which is available to all client side handlers and the client side JAX-WS runtime.
If you want the properties set on BindingProvider request context to be transferred to the server you can implement a custom handler on the client side that puts it in the SOAP header and a server side handler that retrieves the properties from the header and puts it in the message context on the server side. The following is quoted from the JAX-WS 2.1 spec:Handlers may manipulate the values and scope of properties within the message context as desired. E.g.,
a handler in a client-side SOAP binding might introduce a header into a SOAP request message to carry
metadata from a property that originated in a BindingProvider request context; a handler in a server-side
SOAP binding might add application scoped properties to the message context from the contents of a header
in a request SOAP message that is then made available in the context available (via injection) to a service
endpoint implementation.