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
Register / Login
JavaRanch » Java Forums » Java » Web Services
Reply 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: jrebel
 
subject: how to return user defined faultcode
 
Similar Threads
Why Getting Fault Code in SOAP Response Message
SOAP 1.2 Fault children qualified
What's Wrong with this simple WSDL
Problem in Throwing Exception
JAX-WS: when input soap validation fails