I did some fixes to Sandesha2 and Axis2, this Fault messages are flowing correctly now.
Also note that in Sandesha2 you have to get faults and replies in a different channel. So make sure that you mention non-anonymous FaultTo and ReplyTo addresses.
Please take a latest checkout of Sandesha2 and Axis2.
Chamikara
On 7/1/06, Jaliya Ekanayake <[EMAIL PROTECTED]> wrote:
Hi Amitesh,
Yes, It just don't throw the fault. See Chamikara's email.
Thanks,
Jaliya
----- Original Message -----
From: "Amitesh Pandya" <[EMAIL PROTECTED] >
To: "Jaliya Ekanayake" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Friday, June 30, 2006 10:46 AM
Subject: Re: SOAP-FAULT PROBLEM .. please help....
> Hi Jaliya,
> First of all THANKS for replying. I know you are too bussy.
>
> The answer to your question is:
> Yes I've tried the same service without Sandesha and Just pure Axis2.
> And it works fine. I can get the Axis Fault as a SOAP fault in my
> client.
>
> I've tried to debug the code while using Sandesha2 and it seems to be
> a problem in the
>
> run{} method of the " InorderInvoker.java"
>
> The flow of Exception is something like this:
> 1) I throw a NullPointer exception from generated SKELETON class.
> 2) Which in turn throws an Axis fault from the Axis2 generated "InOut"
> class
> (HelloWorldServiceMessageReceiverInOut.java).
> 3) This AxisFault straight away goes into the CATCH block of the run()
> method of the "InOrderInvoker.java".
> 4) There AxisFault is caught and a NEW "SandeshaException" is thrown.
> 5) This new "SandeshaException" get caught by the external CATCH block
> of the same method.
> 6) And I think the problem lies here ?? Because after catching the
> SandeshaException, Nothing is done with it. It is just printed for the
> StackTrace.
> 7) Since the exception is consumed the thread tries to process the
> same message again and goes in an indefinite loop.
>
> Please let me know if this is a known issue or I've to do something
> else to throw SOAP Fault.
>
> Your help will be greatly appreciated. Because we are at a very
> critical path in our project where we will have to take a decision
> soon.
>
> Thanks and Regards
> Amitesh
>
> On 30/06/06, Jaliya Ekanayake <[EMAIL PROTECTED]> wrote:
>> Hi Amitesh,
>>
>> Can you try the same service without Sandesha and see that you get the
>> fault
>> correctly.
>> Let us know.
>>
>> Thanks,
>> -Jaliya
>>
>>
>>
>> ----- Original Message -----
>> From: "Amitesh Pandya" < [EMAIL PROTECTED]>
>> To: <[email protected]>
>> Sent: Friday, June 30, 2006 7:25 AM
>> Subject: SOAP-FAULT PROBLEM .. please help....
>>
>>
>> > Hi there,
>> > I can't believe no one has yet hit this problem or NO ONE has yet tried
>> > it.
>> > I'm sure there is a Solution to this problem. OR it is not a problem
>> > (It's just me who is not using it properly :(
>> >
>> > The problem is regarding sending a SOAPFault to the client from a
>> > reliable service:
>> >
>> > Description: Axis2 v1.0 + Sandesha2 v1.0
>> >
>> > 1) I have an IN-OUT HelloWorldECHO service.
>> > 2) I've generated this service from a WSDL using WSDL2JAVA script.
>> > 3) I've a Reliable client which invokes this service.
>> >
>> > NORMAL invocation works perfect :)
>> >
>> > NOW: I want to throw an exception from my service and want to see it
>> > as a SOAPFAULT in my client.
>> > In order to achive this I do the following things:
>> >
>> > 1) I throw an Exception from the Generated SKELETON class:
>> >
>> > public class ReliableHelloWorldServiceSkeleton{
>> > /**
>> > * Auto generated method signature
>> > */
>> > public HelloWorldDocument
>> > helloWorld(HelloWorldDocument param0 ){
>> >
>> > System.out.println("Message received in the ECHO
>> > Service
>> > is == " + param0);
>> > OMFactory fac = OMAbstractFactory.getOMFactory();
>> > HelloWorldDocument hwDoc =
>> > HelloWorldDocument.Factory.newInstance();
>> > hwDoc.addNewHelloWorld().setInput("ECHO RESPONSE FROM
>> > CLIENT.....");
>> >
>> > throw new NullPointerException();
>> > }
>> >
>> > }
>> >
>> >
>> > 2) In the generated "InOut" class
>> > ( HelloWorldServiceMessageReceiverInOut.java) I don't do a lot but the
>> > code of the "invokeBusinessLogic()" method is below:
>> >
>> > public void invokeBusinessLogic(MessageContext msgContext,
>> > MessageContext newMsgContext)throws AxisFault{
>> > try {
>> > // get the implementation class for the Web Service
>> > Object obj = getTheImplementationObject(msgContext);
>> > //Inject the Message Context if it is asked for
>> >
>> > org.apache.axis2.engine.DependencyManager.configureBusinessLogicProvider(obj,
>> > msgContext.getOperationContext());
>> > ReliableHelloWorldServiceSkeleton skel =
>> > (ReliableHelloWorldServiceSkeleton)obj;
>> > //Out Envelop
>> > org.apache.axiom.soap.SOAPEnvelope envelope = null;
>> > //Find the axisOperation that has been set by the
>> > Dispatch
>> > phase.
>> > org.apache.axis2.description.AxisOperation op =
>> > msgContext.getOperationContext ().getAxisOperation();
>> > if (op == null) {
>> > throw new org.apache.axis2.AxisFault("Operation
>> > is
>> > not
>> > located, if this is doclit style the SOAP-ACTION should specified via
>> > the SOAP Action to use the RawXMLProvider");
>> > }
>> > String methodName;
>> > if(op.getName() != null & (methodName =
>> > op.getName().getLocalPart()) != null){
>> > if("helloWorld".equals(methodName)){
>> >
>> > examples.webservices.reliable.HelloWorldDocument param3 = null;
>> > //doc style
>> > param3 =skel.helloWorld(
>> >
>> > (examples.webservices.reliable.HelloWorldDocument)fromOM(
>> >
>> > msgContext.getEnvelope().getBody().getFirstElement(),
>> >
>> > examples.webservices.reliable.HelloWorldDocument.class,
>> >
>> > getEnvelopeNamespaces(msgContext.getEnvelope())));
>> >
>> > envelope =
>> > toEnvelope(getSOAPFactory(msgContext), param3, false);
>> > }
>> > newMsgContext.setEnvelope(envelope);
>> >
>> > }
>> > }catch (Exception e) {
>> > System.out.println("Reached the CATCH block of the
>> > INOUT");
>> > System.out.println("NOW Throwing the Axis Exception");
>> > throw org.apache.axis2.AxisFault.makeFault(e);
>> > }
>> > }
>> >
>> >
>> > 3) All I expect after this is to see that the "onError()" message get
>> > invoked on my "callback"
>> > at the client side. But I get this on the server side CONTINUOUSLEY:
>> >
>> >
>> >
>> > [07/06/06 11:22:55:210 BST] 00000039 SystemOut O Message received
>> > in the ECHO Service is ==
>> > <helloWorld xmlns="http://examples/webservices/reliable"
>> > xmlns:wsa=" http://schemas.xmlsoap.org/ws/2004/08/addressing"
>> > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>> > <input>THIS IS A TEST MESSAGE FOR ="" ECHO</input>
>> > </helloWorld>
>> > [07/06/06 11:22:55:210 BST] 00000039 SystemOut O Reached the CATCH
>> > block of the INOUT
>> > [07/06/06 11:22:55:210 BST] 00000039 SystemOut O NOW Throwing the
>> > Axis Exception
>> > [07/06/06 11:22:55:225 BST] 00000039 SystemErr R
>> > org.apache.sandesha2.SandeshaException: reasonOFFault; nested
>> > exception is:
>> > java.lang.NullPointerException; nested exception is:
>> > org.apache.axis2.AxisFault: reasonOFFault; nested exception is:
>> > java.lang.NullPointerException
>> > at
>> > org.apache.sandesha2.workers.InOrderInvoker.run(InOrderInvoker.java:199)
>> > Caused by: org.apache.axis2.AxisFault: reasonOFFault; nested exception
>> > is:
>> > java.lang.NullPointerException
>> > at
>> > my.test.serv.schemas.ReliableHelloWorldServiceMessageReceiverInOut.invokeBusinessLogic(ReliableHelloWorldServiceMessageReceiverInOut.java:71)
>> > at
>> > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:37)
>> > at
>> > org.apache.axis2.engine.AxisEngine.resumeReceive(AxisEngine.java:497)
>> > at org.apache.axis2.engine.AxisEngine.resume(AxisEngine.java:543)
>> > at
>> > org.apache.sandesha2.workers.InOrderInvoker.run(InOrderInvoker.java:189)
>> > Caused by: java.lang.NullPointerException
>> > at
>> > my.test.serv.schemas.ReliableHelloWorldServiceSkeleton.helloWorld(ReliableHelloWorldServiceSkeleton.java:22)
>> > at
>> > my.test.serv.schemas.ReliableHelloWorldServiceMessageReceiverInOut.invokeBusinessLogic(ReliableHelloWorldServiceMessageReceiverInOut.java:56)
>> > ... 4 more
>> >
>> > [07/06/06 11:22:55:225 BST] 00000039 SystemErr R at
>> > org.apache.sandesha2.workers.InOrderInvoker.run(InOrderInvoker.java:199)
>> > [07/06/06 11:22:55:225 BST] 00000039 SystemErr R Caused by:
>> > org.apache.axis2.AxisFault: reasonOFFault; nested exception is:
>> > java.lang.NullPointerException
>> > [07/06/06 11:22:55:225 BST] 00000039 SystemErr R at
>> > my.test.serv.schemas.ReliableHelloWorldServiceMessageReceiverInOut.invokeBusinessLogic (ReliableHelloWorldServiceMessageReceiverInOut.java:71)
>> > [07/06/06 11:22:55:225 BST] 00000039 SystemErr R at
>> > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java :37)
>> > [07/06/06 11:22:55:225 BST] 00000039 SystemErr R at
>> > org.apache.axis2.engine.AxisEngine.resumeReceive(AxisEngine.java:497)
>> > [07/06/06 11:22:55:225 BST] 00000039 SystemErr R at
>> > org.apache.axis2.engine.AxisEngine.resume(AxisEngine.java:543)
>> > [07/06/06 11:22:55:225 BST] 00000039 SystemErr R at
>> > org.apache.sandesha2.workers.InOrderInvoker.run (InOrderInvoker.java:189)
>> > [07/06/06 11:22:55:225 BST] 00000039 SystemErr R Caused by:
>> > java.lang.NullPointerException
>> > [07/06/06 11:22:55:225 BST] 00000039 SystemErr R at
>> > my.test.serv.schemas.ReliableHelloWorldServiceSkeleton.helloWorld(ReliableHelloWorldServiceSkeleton.java:22)
>> > [07/06/06 11:22:55:225 BST] 00000039 SystemErr R at
>> > my.test.serv.schemas.ReliableHelloWorldServiceMessageReceiverInOut.invokeBusinessLogic (ReliableHelloWorldServiceMessageReceiverInOut.java:56)
>> > [07/06/06 11:22:55:225 BST] 00000039 SystemErr R ... 4 more
>> > [07/06/06 11:22:56:228 BST] 00000039 SystemErr R
>> > org.apache.sandesha2.SandeshaException: Invalid message addition ,
>> > operation context completed; nested exception is:
>> > org.apache.axis2.AxisFault: Invalid message addition , operation
>> > context completed
>> > at
>> > org.apache.sandesha2.workers.InOrderInvoker.run(InOrderInvoker.java:199)
>> > Caused by: org.apache.axis2.AxisFault: Invalid message addition ,
>> > operation context completed
>> > at
>> > org.apache.axis2.description.InOutAxisOperation.addMessageContext(InOutAxisOperation.java:63)
>> > at
>> > org.apache.axis2.context.OperationContext.addMessageContext(OperationContext.java:85)
>> > at
>> > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java :35)
>> > at
>> > org.apache.axis2.engine.AxisEngine.resumeReceive(AxisEngine.java:497)
>> > at org.apache.axis2.engine.AxisEngine.resume(AxisEngine.java:543)
>> > at
>> > org.apache.sandesha2.workers.InOrderInvoker.run(InOrderInvoker.java:189)
>> >
>> > [07/06/06 11:22:56:228 BST] 00000039 SystemErr R at
>> > org.apache.sandesha2.workers.InOrderInvoker.run (InOrderInvoker.java:199)
>> > [07/06/06 11:22:56:228 BST] 00000039 SystemErr R Caused by:
>> > org.apache.axis2.AxisFault: Invalid message addition , operation
>> > context completed
>> > [07/06/06 11:22:56:228 BST] 00000039 SystemErr R at
>> > org.apache.axis2.description.InOutAxisOperation.addMessageContext(InOutAxisOperation.java:63)
>> > [07/06/06 11:22:56:228 BST] 00000039 SystemErr R at
>> > org.apache.axis2.context.OperationContext.addMessageContext(OperationContext.java:85)
>> > [07/06/06 11:22:56:228 BST] 00000039 SystemErr R at
>> > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive (AbstractInOutSyncMessageReceiver.java:35)
>> > [07/06/06 11:22:56:228 BST] 00000039 SystemErr R at
>> > org.apache.axis2.engine.AxisEngine.resumeReceive(AxisEngine.java:497)
>> > [07/06/06 11:22:56:228 BST] 00000039 SystemErr R at
>> > org.apache.axis2.engine.AxisEngine.resume(AxisEngine.java:543)
>> > [07/06/06 11:22:56:228 BST] 00000039 SystemErr R at
>> > org.apache.sandesha2.workers.InOrderInvoker.run (InOrderInvoker.java:189)
>> > [07/06/06 11:22:57:247 BST] 00000039 SystemErr R
>> > org.apache.sandesha2.SandeshaException: Invalid message addition ,
>> > operation context completed; nested exception is:
>> > org.apache.axis2.AxisFault: Invalid message addition , operation
>> > context completed
>> > at
>> > org.apache.sandesha2.workers.InOrderInvoker.run(InOrderInvoker.java :199)
>> > Caused by: org.apache.axis2.AxisFault: Invalid message addition ,
>> > operation context completed
>> > at
>> > org.apache.axis2.description.InOutAxisOperation.addMessageContext (InOutAxisOperation.java:63)
>> > at
>> > org.apache.axis2.context.OperationContext.addMessageContext(OperationContext.java:85)
>> > at
>> > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive (AbstractInOutSyncMessageReceiver.java:35)
>> > at
>> > org.apache.axis2.engine.AxisEngine.resumeReceive(AxisEngine.java:497)
>> > at org.apache.axis2.engine.AxisEngine.resume (AxisEngine.java:543)
>> > at
>> > org.apache.sandesha2.workers.InOrderInvoker.run(InOrderInvoker.java:189)
>> >
>> >
>> > QUESTIONS:
>> > 1) Is this the right way of throwing exception and receiveng SOAP Fault
>> > ?
>> > 2) If it is not then could you please suggest what should I do to get
>> > the SOAPFault at the client side??
>> >
>> > Thanks and Kind Regards
>> > your help is greatly appreciated
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
