[
https://issues.apache.org/jira/browse/CXF-1434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12858373#action_12858373
]
Eric Pederson edited comment on CXF-1434 at 4/18/10 11:33 PM:
--------------------------------------------------------------
My bad regarding the faultcode. You can throw a
org.apache.cxf.interceptor.Fault, constructing it with your own Exception and
faultCode. You cannot customize the <detail> without using either a Java
static nested inner class faultbean or by using a FaultInterceptor.
For example:
throw new Fault(new AuthorizationError("Error - Missing apiKey"), new
QName("http://ws.foo.com", "InvalidApiKey"))
will result in this response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode xmlns:ns1="http://ws.foo.com">ns1:InvalidApiKey</faultcode>
<faultstring>Error - Missing apiKey</faultstring>
<detail>
<ns1:AuthorizationError xmlns:ns1="http://ws.foo.com/"/>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
was (Author: ericacm):
My bad regarding the faultcode. You can throw a
org.apache.cxf.interceptor.Fault, constructing it with your own Exception and
faultCode. You cannot customize the <detail> without using either a Java
static nested inner class faultbean or by using a FaultInterceptor.
> Better Fault handling demo
> --------------------------
>
> Key: CXF-1434
> URL: https://issues.apache.org/jira/browse/CXF-1434
> Project: CXF
> Issue Type: Wish
> Components: Samples
> Environment: this should run on any servlet container. Java >= 5
> Reporter: David Castaneda
> Priority: Minor
> Attachments: CXFTest.rar, java_first_spring_support_fault.tar,
> java_first_spring_support_faults.zip
>
>
> Sample application showing how to create custom Soap Faults.
> The target is to show a functional example of how to transform Exceptions
> (Checked and Unchecked) to SoapFaults, that can contain Server or Client
> fault and a custom detail part.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.