You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Sagara Gunathunga (JIRA)" <ji...@apache.org> on 2012/06/27 15:01:44 UTC

[jira] [Resolved] (AXIS2-4077) Wrong wsa:Action returned in fault message when an operation declares multiple faults

     [ https://issues.apache.org/jira/browse/AXIS2-4077?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sagara Gunathunga  resolved AXIS2-4077.
---------------------------------------

    Resolution: Fixed

Already fixed.
                
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org