SOAPException
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jim_Pagnotta
Posted On:   Tuesday, November 20, 2001 07:26 AM

I am trying to generate exceptions in my server code for clients to catch. I am trying to use a simple example by throwing a SOAPException from my server. I have included a code snipet. public String getHandleToInstanceRoot() throws SOAPException { AMIHandle handle = getHandleForNode(_instanceTree); String retValue = handle.toString(); if (true) // ensure exception thrown { System.out.println("Creating SOAP exception (9001)"); SOAPException se = new SOAPException("9001", "test exception"); System.out.println("About to throw exception (9001)"); th   More>>


I am trying to generate exceptions in my server code for clients to catch. I am trying to use a simple example by throwing a SOAPException from my server. I have included a code snipet.


public String getHandleToInstanceRoot() throws SOAPException

{

AMIHandle handle = getHandleForNode(_instanceTree);

String retValue = handle.toString();

if (true) // ensure exception thrown

{

System.out.println("Creating SOAP exception (9001)");

SOAPException se = new SOAPException("9001", "test exception");

System.out.println("About to throw exception (9001)");

throw se;

}

return retValue;

}


When my client exercises this server code the server generates a NullPointerException on the throw statement. Current problem aside, is this the proper way to throw an exception across the wire to the client??


Any help would be much appreciated.

   <<Less
About | Sitemap | Contact