Disconnected Service Agent - Failing Requests

Topics: Mobile Client Software Factory
Aug 19, 2006 at 1:14 AM
originally posted by: eekvang

Hi!

I have a question about requests that failes using the disconnected service agent. The RequestDispatched event is fired when a request is removed from the request queue, from this event it is possible to determine whether the execution of the request succeeded, failed or expired. To make an application as robust as possible it would be useful to know what went wrong if something did go wrong.

On an exception callback for a webmethod one can either return OnExceptionAction.Dismiss or OnExceptionAction.Retry. Setting dismiss will result in a Dispatchresult.Failed.

From the event handler that handles RequestDispatched events, it is not possible to separate a network failure from a webmethod exception, both failures will have DispatchResult set to Failed.

Have I understood it correctly? Or is there a way to separate between these types of failures?

Thank you,

Espen
Aug 19, 2006 at 12:12 PM
originally posted by: josegallardo

Hi Espen,

That's true; you don't receive the exception in the RequestDispatchedEventArgs for the event (but you do it in the OnException callbacks).

This event is fired within the DispatchRequestInternal method (part of the DispatchRequestThread class in RequestManager.cs) after a failed or successful dispatch.

Network failures result in a WebException during a web service call. Those exceptions are being thrown by the WebServiceRequestDispatcher to the DispatchRequestInternal.

You can extend the RequestDispatchedEventArgs class including the Exception in order to pass them to the RequestDispatched event handler.

“Server Side” WebExceptions (filtered by the Status property) are handled by the WebServiceRequestDispatcher and those exceptions are being used as parameters for the corresponding OnException callback execution.

I hope this help you.

-Joe
Aug 22, 2006 at 8:37 AM
originally posted by: eekvang

Thank you.

After a closer inspection we have seen that you filter out a set of exceptions (only five) that gets routed to the onException callbacks, the rest is thrown away.

Is there a particular reason why you don't route all exceptions to the onException callbacks?

Thanks again.

Espen