This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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
 
Similar Threads
Why Getting Fault Code in SOAP Response Message
Problem in Throwing Exception
SOAP 1.2 Fault children qualified
JAX-WS: when input soap validation fails
What's Wrong with this simple WSDL