I'm trying to pass an object to the MessageContext from a Weblogic webservice client (Weblogic 9.2). The problem is that the MessageContext does not yet exist prior to invoking the send method on the client, thus it's not possible to retrieve a MessageContext and pass any objects to it using its setProperty(String, Object) method. I want to pass an object to the MessageContext so I can later on retrieve this object in the client's MessageHandler.
I am not familiar with Weblogic servers, but if the web service stack is JAX-WS compatible, here is what you can do:
Proxy classes implements and Dispatch interfaces extends the BindingProvider interface. In this interface, there is a method getRequestContext, which allows you to retrieve a map that is used to initialize the message context for outgoing requests from the client.
References: JAX-WS 2.1 Specification, section 4.2.1.
Joined: Nov 26, 2009
Thanks for your input. Unfortunately Weblogic 9.2 uses JAX-RPC and not JAX-WS, so the BindingProvider tip is not applicable.
Any other ideas? I'm thinking ThreadLocal as an alternative hack to pass properties from the client to the MessageHandler, but it sure would be nice if there was a less hacky way to do this.
subject: Pass object from a webservice client to the MessageContext