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

--- Cut ---

I think there's still one issue, which is how Tuscany would know
whether
afterInvoke() has created a SOAPFault as a normal response.  If
afterInvoke() hasn't done this, then Tuscany needs to throw AxisFault
when afterInvoke() returns.  If afterInvoke() has done this, then
Tuscany needs to return normally to Axis2.  Would it be correct for
Tuscany to look in outMC to see whether afterInvoke() has put a
SOAPFault
in there as a normal response?

You just brought up a good question that makes me think twice before
taking the Fault creation business into my only hands. The right thing
to do as a handler is to plug into the framework and use the underlying
framework's fault handling mechanism instead of managing the fault
myself incurring unnecessary and duplicated work and creating risk of
not conforming to either standards or underlying framework. The issues
here are several. First, if I'm to create the Fault body myself, I would
have to determine what SOAP version to use, SOAP 1.1 or 1.2. Then,
Tuscany runtime needs a way to know if the handler actually created a
Fault. Peek into the outMC is possible, but not a desired way in my
opinion. Also as you mentioned that this will make the execution to take
a different path, so I may have to understand more about Axis2 internals
to make sure the context/content is set correctly for downstream
processing, such as on the client side, etc. Architecturally, this is
not a good solution.

I'll keep thinking and playing with it to see if anything else is
possible.

How about plugging your code into an Axis2 handler instead of a Tuscany
handler?  Is there is a way to get control after Axis2 has built the
SOAPFault and before the fault is sent on the wire?

  Simon

Reply via email to