cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Mazza <glen.ma...@verizon.net>
Subject Re: convert a SOAP Fault to the contained java exception
Date Wed, 26 Mar 2008 09:32:10 GMT
Providing you have the WSDL, you should be able to run wsdl2java and
have a ProcessingFailureException class that will contain that
information.  Look at [1], in particular Step #4 - the wsdl:message
"CorrelationIdNotFoundFault", Step #6, getAdditionResults() method to
see how this object gets thrown from the web service provider, and Step
#10, how this CorrelationIdNotFoundFault exception gets caught and its
underlying data (your "exception" and "reason" fields below) read.

If you're not using JAX-WS' generated Java objects but just using the
Dispatch interface, you can parse the results, look at here[2], Step #6,
for two of three parsing options (Search on "JAX-WS Dispatch provides
three usage options"), and here[3] for JAXBContext (search for "private
void invokeAddNumbers()" <-- the entire string, including ()'s.)

HTH,
Glen

[1] http://www.jroller.com/gmazza/date/20080308
[2] http://www.jroller.com/gmazza/date/20071102
[3] http://www.javapassion.com/handsonlabs/wsjaxwsadv/#Exercise_1


Am Mittwoch, den 26.03.2008, 00:54 -0700 schrieb Davide Gesino:
> Assume I receive an answer such as:
> 
> //	<INFO - <?xml version="1.0" encoding="UTF-8"?>
> //	<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> //	  <soap:Body>
> //	    <soap:Fault>
> //	      <faultcode>soap:Server</faultcode>
> //	      <faultstring>processing failure exception</faultstring>
> //	      <detail>
> //	        <ProcessingFailureException xmlns="tmf854.v1">
> //	          <exception>EXCPT_INTERNAL_ERROR</exception>
> //	          <reason>session_token_unexisting</reason>
> //	        </ProcessingFailureException>
> //	      </detail>
> //	    </soap:Fault>
> //	  </soap:Body>
> //	</soap:Envelope>
> 
> how can I recover the contained java exception? There is some utility code
> in CXF that does that??


Mime
View raw message