Wrong wsa:Action returned in fault message when an operation declares multiple
faults
-------------------------------------------------------------------------------------
Key: AXIS2-4077
URL: https://issues.apache.org/jira/browse/AXIS2-4077
Project: Axis 2.0 (Axis2)
Issue Type: Bug
Components: kernel
Affects Versions: 1.4.1
Reporter: Thomas Hecker
I just noticed that throwing a fault causes Axis to include the wrong
wsa:Action (and also the soap action http header) in the SOAP response when the
following conditions apply:
- Addressing module is engaged
- There are multiple faults declared for the service operation that was invoked
- The AxisFault that is passed by the generated MessageReceiver does not have a
fault action set
When these conditions apply, the wsa:Action header may have the value of a
different fault than the one in the fault detail element.
The problem appears to be in MessageContextBuild.java (line 285):
String faultAction = (e instanceof AxisFault) ?
((AxisFault)e).getFaultAction() : null;
if (faultAction == null) {
AxisOperation op = processingContext.getAxisOperation();
if (op != null && op.getFaultAction() != null) {
// TODO: Should the op be able to pick a fault action based on
the fault?
faultAction = op.getFaultAction();
} else { //If, for some reason there is no value set, should use a
sensible action.
faultAction = Final.WSA_SOAP_FAULT_ACTION;
}
}
The op.getFaultAction() will simply return the action of the first fault among
those declared for the operation. I suggest you change the code to:
String faultAction = (e instanceof AxisFault) ?
((AxisFault)e).getFaultAction() : null;
if (faultAction == null) {
AxisOperation op = processingContext.getAxisOperation();
if (op != null &&
op.getFaultAction((String)processingContext.getProperty(org.apache.axis2.Constants.FAULT_NAME))
!= null) {
faultAction =
op.getFaultAction((String)processingContext.getProperty(org.apache.axis2.Constants.FAULT_NAME));
} else { //If, for some reason there is no value set, should use a
sensible action.
faultAction = Final.WSA_SOAP_FAULT_ACTION;
}
}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]