Hi All,
I am having a question related to Error handling. I learn t that there are 2
kinds of errors.
1.
Errors that could occur from calling services (Business errors)
2.
Errors that might occur when executing framework code
Both types of errors are reported as AxisFaults. Thus we apply policy to
faults also. I am concerned about 2nd types of errors. The issue I am having
is best explained using following example,
Say, I have a web service with sign only security policy applied. Thus
mistakenly I give a wrong keystore alias for server side policy. Now client
sends a request and service needs to send a response. But when service tries
to sign the response it gets an error. This error is reported as an
AxisFault. But there is a sign only policy applied, therefore server again
tries to sign the error (AxisFault). Again Rampart gets the same error.
Since Axis2 framework is removing erroneous phases in an AxisFault this
doesnt goes in a recursive loop. But a HTML page with “HTTP/1.1 500” is
returned to the client. This behavior is reported as an issue in [1].
I am not quite sure about the best possible way to handle this kind of
errors. (Handling framework errors when a policy applied). Also I didnt find
specific spec instructions on how to handle framework failures in a this
kind of scenario. To my understanding we have following options,
1.
Leave the current behavior as it is. i.e. Return a HTTP/1.1 500 error to
client.
2.
If there is an AxisFault, try to apply policy to AxisFault. If framework
gets an error while applying policy to AxisFault, return original AxisFault
(AxisFault before applying policy) to client.
Again this method has a limitation if there is a policy applied in
client side also. E.g :- If client only accepts signed messages,
client will
give an error saying that the incoming message (AxisFault) is not signed.
Please give feedback on what the best way to resolve this issue. Also if
there are more suitable options please let us know.
[1] https://issues.apache.org/jira/browse/RAMPART-305
Thank you
AmilaJ