Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to return user defined faultcode

 
Sushma Sharma
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic