*
The moose likes Web Services and the fly likes Problem with Custom Exceptions in my Axis webservice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Problem with Custom Exceptions in my Axis webservice" Watch "Problem with Custom Exceptions in my Axis webservice" New topic
Author

Problem with Custom Exceptions in my Axis webservice

madhup narain
Ranch Hand

Joined: Dec 14, 2004
Posts: 148
I have been trying to get a custom exception from my web service but haven't been able to do so in the client.
I am using IBM RAD to generate the webservice wsdl and using this WSDL to generate the test client.

On the server side I have the following
1. My Custom exception class

2. And am throwing this exception as follows


On the client Side
I am unable to retrieve this BSPCustomException class. It comes as an AxisFault.


The result of the above in the console is as follows


How can i get the custom exception in the test client. The BSPCustomException is coming in the faultString and also the getCause is null.
It should have been straight forward, Is there something i am missing ?


Money for nothing and Java for Free
SCJP, SCWCD
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 518
    
    2

Hi Madhu,

I have not worked on Axis, but just curious to know, if you do not have the Custom exception class generated when you created the artifacts from WSDL. Have you tried using that exception on client side, instead of AxisFault.


Regards
KumarRaja

Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 576

Hi Madhup,

If you have your web service operation throwing business exception, then it would come as checked exception on the client. From you code, it seems like your business exception is not being thrown from web service interface's method. Can you post your WSDL to see how the interface is defined?


Cheers,
Naren
(OCEEJBD6, SCWCD5, SCDJWS, SCJP1.4 and Oracle SQL 1Z0-051)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with Custom Exceptions in my Axis webservice
 
Similar Threads
soapfaultexception
JAX-WS Custom Exceptions
Soap Fault Implementation
faultDetail element and custom exceptions
Custom Exception handling in Web services