cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Davide Gallina (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CXF-1417) SOAPFaultException built programmatically and thrown in a JAX-WS handler are not correctly populated
Date Fri, 04 Sep 2009 09:37:57 GMT

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

Davide Gallina commented on CXF-1417:
-------------------------------------

Hi,
I searched throughout all the release notes of all CXF 2.1.x versions (from 2.1 to 2.1.6),
but I've never found this issue reported as fixed.
Could you please road me up to the correct fixed version? Or, if possible, could you tell
me which classes are involved, in a way I could try a quick fix?
Thanks a lot,
Davide

> 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