axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bhanu Pabreja" <>
Subject RE: Message Style Service and Exception Handling
Date Mon, 14 Jul 2003 15:02:15 GMT
Thanx for the input but this also does not work. Infact no SOAPResponse is
generated on the SOAPMonitor. Looks like in case of message style service
there are no capabilities to generate SOAPFault which is actually a MUST
element by w3c in case of a  exception.

These are my observations but if someone has a working example which is
MessageStyle based and which propgates exception back to the client using
the SOAPFault or AxisFault it will really help me since I am stuck with this
grave issue.

Thanx in advance.


-----Original Message-----
From: Davanum Srinivas []
Sent: Monday, July 14, 2003 7:42 AM
Subject: Re: Message Style Service and Exception Handling

Try this...

   AxisFault af = AxisFault.makeFault(ex);
   // Do whatever you want with AxisFault
   throw af;

-- dims

--- Bhanu Pabreja <> wrote:
> Hello Everyone,
> I have a MessageStyle service  which has the following signatures:
> 	Document sendData(Document doc) throws RemoteException{}
> Everything works fine till I get an exception:
> I wrote a method like this where I access the SOAPBody on the server side
> and set the faultString and errorCode and return it to the client.
> public static RemoteException setSOAPFaultElement(Exception ex) throws
> RemoteException{
> 		try{
> 		javax.xml.soap.SOAPBody   sb1 =  null;
> 		sb1 =
> elope().getBody();
> 		System.out.println(sb1.getClass());
>             javax.xml.soap.SOAPFault fault = sb1.addFault();
>             fault.setFaultString("Exception " + ex.toString());
>             System.out.println(fault.getFaultString());
>             fault.setFaultCode("Server");
>             System.out.println("Exception is being set in the fault
>             return new RemoteException(ex.toString());
> 		}catch(SOAPException e){
>             throw new RemoteException(ex.toString());
> 		}
> 	}
> But on the client side when I get an exception and in the Exception block
> try to access the exception from the SOAPBody object I get a
> NullPointerExcption and the SOAPBody is empty.
> Then probing further I turned on the SOAPMonitor and discovered that the
> there was no response message in cases where there is exception.
> Thus what I cannnot figure out it is how are exception handled in context
> MessageStyle webservices.
> Any pointers will really help.
> Bhanu Pabreja.

Davanum Srinivas -

Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

View raw message