File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Pass object from a webservice client to the MessageContext Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Pass object from a webservice client to the MessageContext" Watch "Pass object from a webservice client to the MessageContext" New topic
Author

Pass object from a webservice client to the MessageContext

Simon Jensen
Greenhorn

Joined: Nov 26, 2009
Posts: 4
Hi everyone,

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.

Any thoughts on how to achieve this?

Kind regards,
Simon
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
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.
Best wishes!
Simon Jensen
Greenhorn

Joined: Nov 26, 2009
Posts: 4
Hi Ivan,

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pass object from a webservice client to the MessageContext