In between the SOAP client and the SOAP server -
there are  SOAP RPC flows  (inside HTTP over TCP/IP).
You can see this with Axis SOAPMonitor, hence see the flow(s) in each
direction -
if at all. May be this helps you to bridge among the two sides,

Shmuel 

-----Original Message-----
From: Lior Weintraub [mailto:[EMAIL PROTECTED]
Sent: Monday, July 21, 2003 12:33 PM
To: [EMAIL PROTECTED]
Subject: Help! how to catch application exception - in the client?


Hi,

I have the following method I published as web service:
  public String createMediaFile(String name) throws OperationFailedException

Where OperationFailedException extends java.lang.Exception.

I created the wsdl using axis java2wsdl tool.
And created a java client using axis wsdl2java tool.

Now in the client I have the following code:
        try{
            TestExceptionServiceLocator serviceLocator = new
TestExceptionServiceLocator();
            TestException stub =
serviceLocator.getMypackage6TestException();    
            System.out.println(stub.createMediaFile("3"));
        } catch(mypackage6.OperationFailedException oex) {
            oex.printStackTrace();
        } catch(Exception ex) {
            ex.printStackTrace();
        }

The web service throws a OperationFailedException but in the client it
catches the Exception and not OperationFailedException.

Here is the code for the OperationFailedException class:
package mypackage6;
public class OperationFailedException extends Exception
{
  String msg;
  public OperationFailedException()  {
    super();
  }

  public OperationFailedException(String msg) {
    super(msg);
    this.msg=msg;
  }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String newMsg) {
        msg = newMsg;
    }

}

Please tell me if I did something wrong or that user defined exceptions are
simply not handled by axis? Is there a way that the java client can get the
actual java exception that was thrown?

Thanks,
Lior W.

Reply via email to