• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing an Object from Application to Handler

 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I've been googling and trying many possible approaches to do to pass an object from an application (skeleton) to the handler using Axis2 with no luck I don't know if what I'm doing is actually correct. For brevity, below is only the logic of what I've done.

Skeleton (aar):


Handler (mar): --> OutFlow



If the above logic is incorrect, can anyone please tell me how I should go about it?

Many thanks in advance.
[ May 08, 2008: Message edited by: Freddy Wong ]
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where are you setting the property? Remember a new service instance is created for every incoming request and each service instance would have its own message context. So your would have to set the property in the web service method before the method returns.
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm setting it in the web service method. It seems that I need to set it in the ServiceContext. This code below is now working.

Web Service Method:


Handler:


According to JavaDoc for ServiceContext
"Well this is never clearly defined, what it does or the life-cycle. So do NOT use this as it might not live up to your expectation.". I'm a bit scared to use it even though it's working as what I'm expecting.

Do you think what I'm doing is correct? Thanks.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Freddy Wong:
Do you think what I'm doing is correct?


If this article is anything to go by I would look into the OperationContext.

It seems that before you may have been setting the property on the MessageContext for the incoming message - not the outgoing one.

MessageContext has a getOperationContext() method. OperationContext can return a Hashmap of MessageContexts with getMessageContexts() or even retrieve a specific message context if you know the label.
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the late reply. Aha.. that's probably what I need. I'll take a look into that. Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic