cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashwin Deepak Kondhalkar (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CXF-1417) SOAPFaultException built programmatically and thrown in a JAX-WS handler are not correctly populated
Date Wed, 20 May 2009 07:30:45 GMT

    [ https://issues.apache.org/jira/browse/CXF-1417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12711045#action_12711045
] 

Ashwin Deepak Kondhalkar commented on CXF-1417:
-----------------------------------------------

hi,

I am still facing this issue, even if I am using CXF2.1. Will you kindly guide, how this issue
can be fixed?

Thanks & Regards
 Ashwin

> SOAPFaultException built programmatically and thrown in a JAX-WS handler are not correctly
populated
> ----------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1417
>                 URL: https://issues.apache.org/jira/browse/CXF-1417
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>    Affects Versions: 2.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.1
>         Environment: whatever
>            Reporter: Davide Gesino
>            Assignee: Daniel Kulp
>             Fix For: 2.0.5, 2.1
>
>
> Create a SOAPFaultException filled with a SOAPFault and throw it from a JAX-WS Hander.
> On the other side some content of the SOAPFaultException is missing.
> Here is a code that can be tried: create a SOAPHandler with the following handleMessage().
> public boolean handleMessage(SOAPMessageContext ctx) {
>                 Boolean outboundProperty = (Boolean) ctx
>                                 .get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
>                 if (!outboundProperty) {
>                         SOAPMessage msg = ctx.getMessage();
>                         SOAPBody body;
>                         try {
>                                 body = msg.getSOAPBody();
>                                 SOAPFault fault = body.addFault();
>                                 QName faultName = new QName(SOAPConstants.URI_NS_SOAP_ENVELOPE,
>                                                 "Server");
>                                 fault.setFaultCode(faultName);
>                                 fault.setFaultActor("http://gizmos.com/orders");
>                                 fault.setFaultString("Server not responding");
>                                 Detail detail = fault.addDetail();
>                                 QName entryName = new QName("http://gizmos.com/orders/",
>                                                 "order", "PO");
>                                 DetailEntry entry = detail.addDetailEntry(entryName);
>                                 entry.addTextNode("Quantity element does not have a value");
>                                 QName entryName2 = new QName("http://gizmos.com/orders/",
>                                                 "order", "PO");
>                                 DetailEntry entry2 = detail.addDetailEntry(entryName2);
>                                 entry2.addTextNode("Incomplete address: no zip code");
>                                 throw new SOAPFaultException(fault);
>                         } catch (SOAPException e) {
>                                 // TODO Auto-generated catch block
>                                 e.printStackTrace();
>                         }
>                 }
>                 return true;
>         } 
> This is what I would expect:
> <soapenv:Fault>
>       <faultcode>soapenv:Server</faultcode>
>       <faultstring>Server not responding</faultstring>
>       <faultactor>http://gizmos.com/orders</faultactor>
>       <detail>
>         <PO:order xmlns:PO="http://gizmos.com/orders/">Quantity element does not
have a value</PO:order>
>         <PO:order xmlns:PO="http://gizmos.com/orders/">Incomplete address: no zip
code</PO:order>
>       </detail>
>   </soapenv:Fault>
> And this is what I get:
>  <soap:Fault>
>       <faultcode>soap:Server</faultcode>
>       <faultstring>Server not responding</faultstring>
> </soap:Fault>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message