You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sean Wellington (JIRA)" <ji...@apache.org> on 2008/10/08 00:44:44 UTC
[jira] Created: (CXF-1848) Can't specify SOAP faultcode for
exceptions
Can't specify SOAP faultcode for exceptions
-------------------------------------------
Key: CXF-1848
URL: https://issues.apache.org/jira/browse/CXF-1848
Project: CXF
Issue Type: Improvement
Components: JAX-WS Runtime, Soap Binding
Affects Versions: 2.1.2
Reporter: Sean Wellington
All exceptions with @WebFault annotation are forced to carry a SOAP faultcode of "Server". There is no way to change this.
I traced through the code and the logic in AbstractInvoker seems to be:
1. If the exception is a subclass of Fault, throw it as-is;
2. Otherwise wrap it in a new instance of Fault, and use the faultcode of "Server" as a default.
This is fine until the exception bubbles up to WebFaultOutInterceptor, around line 94, where it filters out anything that isn't a subclass of exception (Fault is a RuntimeException). So the net effect is that the getFaultInfo() method is ignored.
The only workaround is to totally roll your own exception responses using the DOM APIs via Fault.getDetails(). This is undesirable.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CXF-1848) Can't specify SOAP faultcode for
Exceptions that use @WebFault
Posted by "Dr. Dietmar Wolz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-1848?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12916865#action_12916865 ]
Dr. Dietmar Wolz commented on CXF-1848:
---------------------------------------
Unfortunately I cannot reproduce the fix using CXF 2.2.10.
Tried the following:
SOAPFaultException ex = null;
try {
SOAPFactory factory = SOAPFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
SOAPFault fault = factory.createFault();
fault.setFaultString("faultString");
fault.setFaultCode("wst:FailedAuthentication");
ex = new SOAPFaultException(fault);
} catch (SOAPException e) {
e.printStackTrace();
}
throw new ReadFaultMsg("No element with key '"
+ parameters.getKey() + "'", "This is a detail!",ex);
on the wire (using a http tracer) i see the following reply
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>No element with key 'Hasi'</faultstring><detail><ns2:ElementNotFoundFault xmlns:ns2="http://services.sopware.org/demo/Whiteboard">This is a detail!</ns2:ElementNotFoundFault></detail></soap:Fault></soap:Body></soap:Envelope>
which has "soap:Server" and not "wst:FailedAuthentication" as fault code,
what did I wrong?
> Can't specify SOAP faultcode for Exceptions that use @WebFault
> --------------------------------------------------------------
>
> Key: CXF-1848
> URL: https://issues.apache.org/jira/browse/CXF-1848
> Project: CXF
> Issue Type: Improvement
> Components: JAX-WS Runtime, Soap Binding
> Affects Versions: 2.1.2
> Reporter: Sean Wellington
> Fix For: Invalid
>
>
> All exceptions with @WebFault annotation are forced to carry a SOAP faultcode of "Server". There is no way to change this.
> I traced through the code and the logic in AbstractInvoker seems to be:
> 1. If the exception is a subclass of Fault, throw it as-is;
> 2. Otherwise wrap it in a new instance of Fault, and use the faultcode of "Server" as a default.
> This is fine until the exception bubbles up to WebFaultOutInterceptor, around line 94, where it filters out anything that isn't a subclass of exception (Fault is a RuntimeException). So the net effect is that the getFaultInfo() specified by @WebFault method is ignored.
> The only workaround is to totally roll your own exception responses using the DOM APIs via Fault.getDetails(). This is undesirable.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CXF-1848) Can't specify SOAP faultcode for
Exceptions that use @WebFault
Posted by "Sean Wellington (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-1848?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sean Wellington updated CXF-1848:
---------------------------------
Description:
All exceptions with @WebFault annotation are forced to carry a SOAP faultcode of "Server". There is no way to change this.
I traced through the code and the logic in AbstractInvoker seems to be:
1. If the exception is a subclass of Fault, throw it as-is;
2. Otherwise wrap it in a new instance of Fault, and use the faultcode of "Server" as a default.
This is fine until the exception bubbles up to WebFaultOutInterceptor, around line 94, where it filters out anything that isn't a subclass of exception (Fault is a RuntimeException). So the net effect is that the getFaultInfo() specified by @WebFault method is ignored.
The only workaround is to totally roll your own exception responses using the DOM APIs via Fault.getDetails(). This is undesirable.
was:
All exceptions with @WebFault annotation are forced to carry a SOAP faultcode of "Server". There is no way to change this.
I traced through the code and the logic in AbstractInvoker seems to be:
1. If the exception is a subclass of Fault, throw it as-is;
2. Otherwise wrap it in a new instance of Fault, and use the faultcode of "Server" as a default.
This is fine until the exception bubbles up to WebFaultOutInterceptor, around line 94, where it filters out anything that isn't a subclass of exception (Fault is a RuntimeException). So the net effect is that the getFaultInfo() method is ignored.
The only workaround is to totally roll your own exception responses using the DOM APIs via Fault.getDetails(). This is undesirable.
> Can't specify SOAP faultcode for Exceptions that use @WebFault
> --------------------------------------------------------------
>
> Key: CXF-1848
> URL: https://issues.apache.org/jira/browse/CXF-1848
> Project: CXF
> Issue Type: Improvement
> Components: JAX-WS Runtime, Soap Binding
> Affects Versions: 2.1.2
> Reporter: Sean Wellington
>
> All exceptions with @WebFault annotation are forced to carry a SOAP faultcode of "Server". There is no way to change this.
> I traced through the code and the logic in AbstractInvoker seems to be:
> 1. If the exception is a subclass of Fault, throw it as-is;
> 2. Otherwise wrap it in a new instance of Fault, and use the faultcode of "Server" as a default.
> This is fine until the exception bubbles up to WebFaultOutInterceptor, around line 94, where it filters out anything that isn't a subclass of exception (Fault is a RuntimeException). So the net effect is that the getFaultInfo() specified by @WebFault method is ignored.
> The only workaround is to totally roll your own exception responses using the DOM APIs via Fault.getDetails(). This is undesirable.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CXF-1848) Can't specify SOAP faultcode for
Exceptions that use @WebFault
Posted by "Sean Wellington (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-1848?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sean Wellington updated CXF-1848:
---------------------------------
Summary: Can't specify SOAP faultcode for Exceptions that use @WebFault (was: Can't specify SOAP faultcode for exceptions)
> Can't specify SOAP faultcode for Exceptions that use @WebFault
> --------------------------------------------------------------
>
> Key: CXF-1848
> URL: https://issues.apache.org/jira/browse/CXF-1848
> Project: CXF
> Issue Type: Improvement
> Components: JAX-WS Runtime, Soap Binding
> Affects Versions: 2.1.2
> Reporter: Sean Wellington
>
> All exceptions with @WebFault annotation are forced to carry a SOAP faultcode of "Server". There is no way to change this.
> I traced through the code and the logic in AbstractInvoker seems to be:
> 1. If the exception is a subclass of Fault, throw it as-is;
> 2. Otherwise wrap it in a new instance of Fault, and use the faultcode of "Server" as a default.
> This is fine until the exception bubbles up to WebFaultOutInterceptor, around line 94, where it filters out anything that isn't a subclass of exception (Fault is a RuntimeException). So the net effect is that the getFaultInfo() method is ignored.
> The only workaround is to totally roll your own exception responses using the DOM APIs via Fault.getDetails(). This is undesirable.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (CXF-1848) Can't specify SOAP faultcode for
Exceptions that use @WebFault
Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-1848?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Kulp resolved CXF-1848.
------------------------------
Resolution: Fixed
Fix Version/s: Invalid
Fixed a long time ago.
Per spec, if the Cause of the exception is a SOAPFaultException we copy the values such as the fault code, message, etc... out of there.
> Can't specify SOAP faultcode for Exceptions that use @WebFault
> --------------------------------------------------------------
>
> Key: CXF-1848
> URL: https://issues.apache.org/jira/browse/CXF-1848
> Project: CXF
> Issue Type: Improvement
> Components: JAX-WS Runtime, Soap Binding
> Affects Versions: 2.1.2
> Reporter: Sean Wellington
> Fix For: Invalid
>
>
> All exceptions with @WebFault annotation are forced to carry a SOAP faultcode of "Server". There is no way to change this.
> I traced through the code and the logic in AbstractInvoker seems to be:
> 1. If the exception is a subclass of Fault, throw it as-is;
> 2. Otherwise wrap it in a new instance of Fault, and use the faultcode of "Server" as a default.
> This is fine until the exception bubbles up to WebFaultOutInterceptor, around line 94, where it filters out anything that isn't a subclass of exception (Fault is a RuntimeException). So the net effect is that the getFaultInfo() specified by @WebFault method is ignored.
> The only workaround is to totally roll your own exception responses using the DOM APIs via Fault.getDetails(). This is undesirable.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.