axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shrish Mishra <>
Subject [Axis2] Problem with client side exceptions
Date Tue, 13 Nov 2007 17:57:06 GMT

I have finally figured out a workaround.As described in the mail below we get
tag <soapenv:Detail /> as blank at client, so exceptions are not created at
client side, and they are thrown as axisfault. Looking back at the server
side generated code I figured out that to populate detail tag, it needs
information from the exception which could be string or a bean object, and
if it is present then it creates proper <detail> tag and at client side the
exception are regenerated.
So add following code to your exception class. Set message in exception
before throwing. It works fine, I tried that !!

	private String faultMessage;

	public void setFaultMessage(String faultMessage) {
		this.faultMessage = faultMessage;

             public String getFaultMessage() {
		return faultMessage;

Shrish Mishra wrote:
> 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
> 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
> 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 !!

View this message in context:
Sent from the Axis - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message