I also have the same problem. I could not get back the original exception at
client side. I tried using sample/faulthandling code with the axis2
distribution and it works fine. But now the problem is, this example
generates client side and server side code from the wsdl ... but the source
code (service code) from which  this wsdl was generated is not present with
the distribution:

In the faulthandinling example it soap message has exception information in
the <detail></detail> tag

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://sc
hemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapen
v:Server</faultcode><faultstring>Account does not
exist!</faultstring><detail><n
s1:AccountNotExistFault
xmlns:ns1="http://example";><ns1:account>13</ns1:account>
</ns1:AccountNotExistFault></detail></soapenv:Fault></soapenv:Body></soapenv:Env
elope>

So soap engine is able to read and regenerate the exception. but when I
tried with my service implementaion this information does not come in the
soap message rather it comes in the header of the http response as action
but <detail></detail> tag is empty. Please See below

HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: application/soap+xml;
action="urn:testExceptionMyCheckedException"
;charset=UTF-8
Transfer-Encoding: chunked
Date: Wed, 07 Nov 2007 01:46:49 GMT
Connection: close

187
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://ww
w.w3.org/2003/05/soap-envelope"><soapenv:Body><soapenv:Fault><soapenv:Code><soap
env:Value>soapenv:Receiver</soapenv:Value></soapenv:Code><soapenv:Reason><soapen
v:Text xml:lang="en-US">Checked Exception thrown
!!</soapenv:Text></soapenv:Reas
on><soapenv:Detail /></soapenv:Fault></soapenv:Body></soapenv:Envelope>
0

Can someone please give me some pointer or at lease provide the source code
for that faulthanding example.

Thanks !!




Pär Malmqvist wrote:
> 
> 
> I also have problem with this. 
> My best shot is to set the parameter DrillDownToRootCauseForFaultReason to
> true in the axis2.xml configuration file at the server side. 
> Then I can read the exception&nbsp;name&nbsp;(among a lot of other
> exceptions)&nbsp;in a field in the AxisFault message at the client side. I
> think&nbsp;I used&nbsp;the method getDetails(). 
> But I dont think this is a good solution... :( 
> /Pär 
> &nbsp; 
> 
> 
> 
> 
> From:&nbsp;&nbsp;"John McLaughlin" &lt;[EMAIL PROTECTED]&gt;
> Reply-To:&nbsp;&nbsp;[email protected]
> To:&nbsp;&nbsp;[email protected] Subject:&nbsp;&nbsp;Problem with
> client side exceptions Date:&nbsp;&nbsp;Wed, 5 Sep 2007 15:50:39 +0100 
> Hi&nbsp; all, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I'm a newbie to
> Axis2, though have used Axis1 before, and am having trouble with
> exceptions on the client end. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> I've deployed a POJO as a service under Tomcat. I generated the service
> and client using Eclipse WTP, so to be as brief as possible, the service
> has a method:
> &nbsp;&nbsp;&nbsp; public CounterLight getCounter(Long nsuk)
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throws CounterNotFoundException
> &nbsp;&nbsp;&nbsp; { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw new
> CounterNotFoundException("Exception!!!!") ; &nbsp;&nbsp;&nbsp; }
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CounterNotFoundException is
> simply an extension of
> java.lang.Exception (it implements Serializable as well, though I don't
> think this makes any difference) &nbsp;&nbsp;&nbsp; Wsdl2java generates a
> class called CounterNotFoundExceptionException2 alongside the stub for the
> service
> &nbsp;&nbsp;&nbsp; On the client side I have: &nbsp;&nbsp; try {
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stub.getCounter(params) ; //
> Params initialised properly etc &nbsp;&nbsp; } &nbsp;&nbsp;
> catch(CounterNotFoundExceptionException2 e) {
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.printStackTrace() ; 
> &nbsp;&nbsp;&nbsp; } &nbsp;&nbsp;&nbsp; catch (AxisFault e) {
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.printStackTrace() ;
> &nbsp;&nbsp;&nbsp; } &nbsp;&nbsp;&nbsp; The AxisFault is ALWAYS the one
> that is received, never the generated exception (though the compiler
> insists that I check for it). 
> &nbsp;&nbsp;&nbsp; On the server side, I also get a
> "java.lang.reflect.InvocationTargetException...Caused by CounterException"
> &nbsp;&nbsp;&nbsp; Can anybody point me in the right direction here, am I
> missing something? I've googled extensively, searched the list archives
> etc, but couldn't find much of help.
> Thanks for any help! John 
> 
> Express yourself instantly with MSN Messenger! MSN Messenger  Download
> today it's FREE!
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-client-side-exceptions-tf4384590.html#a13620214
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to