axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eran Chinthaka <chinth...@opensource.lk>
Subject Re: [Axis2] Sharing properties among MessageContexts
Date Thu, 25 Aug 2005 09:50:34 GMT
Wow wow, wait.
Don't try to set the properties of the out message, from the IN path. 
You can set it, sometimes (after dispatch phase), but the best thing is 
to set the value to the current msgCtxt, and let the OUT handler to 
retrieve those info, thru operation context.

Got it this time ??

-Chinthaka

Ruchith Fernando wrote:

>But we might not have the operation context to set it since most of
>the time operation context will not be avilable when the inflow
>security handler runs, since the security IN handler (WSDoAllReceiver)
>is to be run in the 'PreDispatch' phase.
>
>- Ruchith
>
>On 8/25/05, Sanjiva Weerawarana <sanjiva@opensource.lk> wrote:
>  
>
>>Is it really a property which is shared across all the messages of an
>>operation?
>>
>>If yes, there's an obvious place to store them: operation context!
>>That's the reason we created operation context in the first place ..
>>
>>Sanjiva.
>>
>>On Thu, 2005-08-25 at 15:00 +0600, Ruchith Fernando wrote:
>>    
>>
>>>oh yeah :-)
>>>I will copy the parm over to the out message context in the
>>>WSDoAllSender when the handler is invoked.
>>>
>>>Thanks
>>>Ruchith
>>>
>>>
>>>On 8/25/05, Eran Chinthaka <chinthaka@opensource.lk> wrote:
>>>      
>>>
>>>>Please see my comments below,
>>>>
>>>>Ruchith Fernando wrote:
>>>>
>>>>        
>>>>
>>>>>Hi All,
>>>>>
>>>>>I just ran into a small issue in porting WSS4J handlers to the
>>>>>Axis2-WSS4J module.
>>>>>
>>>>>There are instances where the handler in the out flow (WSDoAllSender)
>>>>>requires the security processing information - WSHandlerResult vector
>>>>>on org.apache.ws.security.handler.WSHandlerConstants.RECV_RESULTS key
>>>>>          
>>>>>
>>>>>from the message context set by the inflow handler (WSDoAllreceiver).
>>>>        
>>>>
>>>>>In Axis 1.x, since the same MessageContext is shared for both incoming
>>>>>and outgoing message it can be used to hold this information. But in
>>>>>the case of Axis2, each message has its own message context and we
>>>>>will have to copy the properties over to the new MessageContext for
>>>>>the outgoing message.
>>>>>
>>>>>Right now such properties are copied over to the new (out flow)
>>>>>message context at the AbstractInOutSyncMessageReceiver and
>>>>>AbstractInOutAsyncMessageReceiver.
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>No this is not the case in Axis2. Please don't do this in message
>>>>receiver. Message Receiver will only copy addressing information. Other
>>>>handlers will have to share information as follows.
>>>>
>>>>The correct way is this.
>>>>In the OUT handler,
>>>>msgCtx.getOperationContext().getMessageContext(WSDLConstants.MESSAGE_LABEL_IN).
>>>>
>>>>
>>>>This will return the IN message context.
>>>>
>>>>        
>>>>
>>>>>Therefore the RECV_RESULTS can be copied over using the same mechanism.
>>>>>
>>>>>However  I will have to introduce a new constant value to the MessageContext.
>>>>>RECV_RESULTS having the same value as
>>>>>org.apache.ws.security.handler.WSHandlerConstants
>>>>>Since IF I used the constant in
>>>>>org.apache.ws.security.handler.WSHandlerConstants as the key to store
>>>>>the property in the message context it will impose the Axis2 core to
>>>>>depend on WSS4J !!!
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>I didn't get the question. Can u elaborate a bit please.
>>>>
>>>>Regards,
>>>>Chinthaka
>>>>
>>>>        
>>>>
>>>>>Any comments? :-)
>>>>>
>>>>>Thanks
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>        
>>>>
>>>      
>>>
>>    
>>
>
>
>  
>

Mime
View raw message