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
[EMAIL PROTECTED]
http://www.dankulp.com/blog