[
https://issues.apache.org/jira/browse/AXIS2-4077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12990631#comment-12990631
]
Katherine Sanders commented on AXIS2-4077:
------------------------------------------
This issue has been fixed under AXIS2-4922 / revision 1059115
> 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: Axis2
> Issue Type: Bug
> Components: Addressing
> 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.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]