Yang, Gang CTR US USA wrote:
Classification: UNCLASSIFIED
Caveats: NONE

(cut)

Hi, Simon,

I have not been able to find any workaround for case 1 and 2. I can see
in the debugger that the generation of response message from the
AxisFault happens much later and I agree with you that it's not a simple
fix. It looks to me that I have to live with it. It's not the end of
world since we achieved the main goal by blocking the request in
beforeInvoke. It's just the response that is not gracefully handled by
security process.

One other idea that I had is to use an Axis2 handler that gets control
after the response message has been built, and have this handler look for
ThreadLocal information that you have previously set up in your Tuscany
handlers.  This would allow you to do the necessary processing only in the
specific cases where it is needed from a Tuscany perspective, and leave
other cases unchanged.

If you are interested in pursuing this, it would probably be possible
to find a way to modify/override the settings in axis2.xml without
having to patch the tuscany-sca-all jar.  For example, [1] seems to
indicate that these settings can be overriden by runtime code.

For case 3, will afterInvoke will be called with the response
MessageContext that contains the response SOAP message? If so, I would
like your proposed workaround/fix for case 3 to be included if possible.
It'll give us a compatible Fault handling with other services
(non-Tuscany). It'll also enable auditing when Fault occurs.
That depends on how Axis2 behaves when it throws an Axisfault from
operationClient.execute().  Tuscany could do the following after it
catches AxisFault, as it does in the non-AxisFault case:

MessageContext responseMC = 
operationClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
for ( PolicyHandler policyHandler : policyHandlerList ) {
    policyHandler.afterInvoke(msg, responseMC, operationClient);
}

This will do what you want if Axis2 puts the response SOAP message in
the response MessageContext before it throws the AxisFault.  It won't
do what you want if Axis2 just throws the AxisFault and doesn't set up
the response MessageContext.

  Simon

[1] http://wso2.org/library/585

Thanks,
Gang

Classification: UNCLASSIFIED
Caveats: NONE





Reply via email to