File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes how to return user defined faultcode Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "how to return user defined faultcode" Watch "how to return user defined faultcode" New topic
Author

how to return user defined faultcode

Sushma Sharma
Ranch Hand

Joined: Jun 02, 2005
Posts: 139
Hi,

I want to change the faultcode. I am using axis2-1.3 and jdk1.5 and jboss4.2.2GA.
I have following :


I want the following:



how to do this or is it possible to do it?

Thanks,
Sushma
Shinelin Samuel
Ranch Hand

Joined: Mar 01, 2010
Posts: 55
Yes, you can add custom faultCode to your soap message.

Refer FaultCode interface, it provide setFaultCode(String name), which help you in this regard.
Sushma Sharma
Ranch Hand

Joined: Jun 02, 2005
Posts: 139
for anyone looking for answer, here is what I did in my code. Instead of throwing Exception, I throw Axisfault.



and it results in the following response:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to return user defined faultcode