Classification: UNCLASSIFIED Caveats: NONE --- cut ---
> 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. Good thought as a workaround. But the issue is that the global Axis2 handler does not have the right certs/keys, which is configured per service/reference, and I don't want to subject them to sharing by putting them on ThreadLocal - your argument:-). > > > 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. > Maybe I should take a look at the context in the debugger before we do anything. Classification: UNCLASSIFIED Caveats: NONE