none
Handling exceptions in CSF 3.0 RRS feed

  • Question

  • hi,

    I have a class from where I route messages to session service. I call all services asynchronously and hence i have defined a method in this class where service responses are recieved and handled.

    Now in case an error occurs(from web services that are called by Session services), I have defined a method called HandleError(SoapFaultException ex) and also added ACTION EQ (http://schemas.xmlsoap.org/ws/2004/08/addressing/fault) in manifest file.

    In the messages that I send to services, i have added reference property for correlation as I am not using CSF's correlation mechanism.

    In method HandleError, how can I retrieve this Id. ID exists in soap envelope in Reply property, but I recieve SoapFaultException as input to this method. I dont recieve Message so that i can use some API like Message.Header.Properties.GetProperty(). How do I get "Message" from SoapFaultException class?There is no API in SoapFaultException class to read the "Message" and its properties.

    Any help would be appreciated.

    Tirath

     

     

    Tuesday, October 31, 2006 8:42 AM

Answers

  • I have answered similar question in another thread.

    If you have following routing criteria you will be able to get all the faults to the ErrorHandlerAction

    <Route>

          <Criteria>MESSAGE EQ 'Fault' AND MESSAGENS EQ 'http://schemas.xmlsoap.org/soap/envelope/' </Criteria> 

        <Destination>InitiatorService[ErrorHandlerAction]</Destination>

     </Route>

    Thanks

    Friday, November 3, 2006 9:37 PM

All replies

  • Hello Tirath,

    I am not sure whether this would work. But give it a try.

    Override the ProcessMessage method of CsfService.

    You will obviously receive the Message in this method. Check if this Message has the reference properties that you have set.

    Give it a try and let me know.

    Regards,

    Vikram

    Wednesday, November 1, 2006 3:12 PM
  • Hi Vikram,

    Thanks for the reply. However I do not want to change anything for normal and successful scenarios. Overriding ProcessMessage method will mean changing something in normal scenarios as well. But I just want to handle Error scenarios so that I can retrieve actual Message from exception. Isnt there any other option available?

    Thanks

     

     

     

    Wednesday, November 1, 2006 6:32 PM
  • Hello Tirath,

    There is an option.

    Instead of accepting SoapFaultException parameter in your method, accept a Message type parameter.

    The SoapFaultException object will be present in the Message body. You can retrieve it. Also I suppose you will be able to get your reference properties intact in the Message.

    Regards,

    Vikram

    Thursday, November 2, 2006 4:16 AM
  • I have answered similar question in another thread.

    If you have following routing criteria you will be able to get all the faults to the ErrorHandlerAction

    <Route>

          <Criteria>MESSAGE EQ 'Fault' AND MESSAGENS EQ 'http://schemas.xmlsoap.org/soap/envelope/' </Criteria> 

        <Destination>InitiatorService[ErrorHandlerAction]</Destination>

     </Route>

    Thanks

    Friday, November 3, 2006 9:37 PM
  • Use the message available in the request context . i.e., RequestContext.Message, will contian the message you recieved.

    thanks

    Reddy

    Sunday, November 26, 2006 10:27 AM