axis2 question about sending & recieveing SOAP Fault

J

J Jensen

Hello

I am just trying to throw and catch a SOAP Fault (well, AxisFault)
from a simple Axis2 web service.
The Axis2-1.3 distribution comes with a faulthanding example, but it
seems rather complicated and has lots of auto generated classes. I am
sure it is simpler than that.

Let's take the StockQuoteService example, in axis2-1.3\samples
\quickstart. The client sends a string like "WSO" and the service
returns a quote like "123.23". I'd like to send in the string "XYZ"
and get the service to throw an AxisFault with a message, and the
client catches it.

So what would I need to do? I'm guessing:

1. Modify StockQuoteService.java to have something like:
if( symbol.equals("XYZ")) throw
new AxisFault( new QName("http://test.org", "FaultCode",
"test"),
"FaultReason",
new Exception("This is a test Exception"));

2. Put something in services.xml, but what??

3. Put a catch block in the client code
catch( AxisFault af)
{
af.getMessage();
}

Any help would be appreciated!
--Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top