cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: SOAPFaultException missing custom error data
Date Wed, 14 May 2008 18:03:04 GMT


While debugging this, I just realized that the soap fault in your  
message is NOT a valid soap 1.2 fault.   That's why it's not finding  
the details.   For SOAP 1.2, the details element needs to be  
<soap:Detail>, not <details>.   If you have access to the service, you  
should definitely get it updated to generate correct 1.2 faults.

Anyway, I'm going to say, as far as CXF is concerned, "not a bug".


Dan



On May 13, 2008, at 5:42 PM, tywebb wrote:

>
> Dan,
>
> Thank you for your replay.  Unfortunately this is precisely the  
> problem I am
> having.  I would expect, as you did, that the contents of the  
> <detail> tag
> (see my payload example) be accessible through
> sfe.getFault().getDetail().getDetailEntries()  but getDetailEntries  
> and all
> other seemingly relevant methods return null.  Any other thoughts?
>
> Thanks
>
>
>
>
> dkulp wrote:
>>
>>
>>
>> sfe.getFault().getDetail().getDetailEntries() should return an
>> Iterator that allows you to iterate over the detail contents.
>>
>> Note: The Detail object returned from sfe.getFault().getDetail()
>> implements the org.w3c.dom.Element stuff so any of the XML apis  
>> should
>> be able to be used to process it.
>>
>> Dan
>>
>>
>> On May 9, 2008, at 12:27 PM, tywebb wrote:
>>
>>>
>>> I am using CXF 2.1 generated clients to consume web services written
>>> in .NET.
>>> The application previously used Apache Axis1 (v 1.4) to consume
>>> these same
>>> web services and I did not encounter this issue.  Unfortunately, I
>>> have no
>>> control over the content or structure of the WSDL's so I am hoping
>>> the issue
>>> does lie there.
>>>
>>> When calling our login web service, the server will return "error"
>>> messages
>>> embedded in the soap payload that I can use to build Java
>>> Exceptions.  With
>>> Axis i was easily able to catch org.apache.axis.AxisFault exceptions
>>> and
>>> parse its "faultDetails" to retrieve the information I need.
>>>
>>> When calling these same services with CXF generated clients, I
>>> recieve a
>>> javax.xml.ws.soap.SOAPFaultException but I am unable to find the  
>>> error
>>> details anywhere in that object graph.
>>>
>>> Below is the Inbound payload CXF logs after a failed login attempt.
>>> All I
>>> want/need is access to the data wrapped in the <detail> tag.  I was
>>> able to
>>> do this quite easily with Axis with no special configuration.  What
>>> am I
>>> missing that is preventing me from getting this information out of
>>> CXF/SOAPFaultException
>>>
>>> CXF Inbound Payload...
>>>
>>> <?xml version="1.0" encoding="utf-8"?>
>>> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>>>   <soap:Body>
>>>       <soap:Fault>
>>>           <soap:Code>
>>>               <soap:Value>soap:Sender</soap:Value>
>>>           </soap:Code>
>>>           <soap:Reason>
>>>               <soap:Text xml:lang="en">SOAP Fault Occurred</
>>> soap:Text>
>>>           </soap:Reason>
>>>           <detail>
>>>               <ServiceMethod></ServiceMethod>
>>>               <ErrorCode>-200</ErrorCode>
>>>               <ErrorMessage>INVALID USER LOGIN ID</ErrorMessage>
>>>               <ErrorDump>Exception Handled By Database</ErrorDump>
>>>           </detail>
>>>       </soap:Fault>
>>>   </soap:Body>
>>> </soap:Envelope>
>>> -- 
>>> View this message in context:
>>> http://www.nabble.com/SOAPFaultException-missing-custom-error-data-tp17151614p17151614.html
>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>
>>
>> ---
>> Daniel Kulp
>> dkulp@apache.org
>> http://www.dankulp.com/blog
>>
>>
>>
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/SOAPFaultException-missing-custom-error-data-tp17151614p17219031.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog





Mime
View raw message