• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pass object from a webservice client to the MessageContext

 
Simon Jensen
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic