WCF service AsyncCallbackException
Last post 05-13-2008 4:16 AM by Mavaho. 2 replies.
Sort Posts:
05-08-2008 6:51 AM
WCF service AsyncCallbackException

 I'm currently having a problem with Silverlight using WCF.  When I run my project I get a weird error which is not telling me much. It's some sort of problem with calling a service. After some searching I tried a couple of things, like this site or this one , but the info there couldn't help me fix my problem.  When I go to the service in the browser, I get no problems, it shows the service and the wsdl correctly so don't really know what the problem is here.  Anyone encountered and/or fixed this before?

The full error report is: 

Microsoft JScript runtime error: Sys.InvalidOperationException: ManagedRuntimeError error #4002 in control 'ctl00_cphContent_Silverlight': System.Exception: [AsyncCallbackException]
Arguments:
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See
http://go.microsoft.com/fwlink/?linkid=106663&Version=2.0.30226.2&File=System.ServiceModel.dll&Key=AsyncCallbackException ---> System.Exception: [AsyncCallbackException]
Arguments:
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See
http://go.microsoft.com/fwlink/?linkid=106663&Version=2.0.30226.2&File=System.ServiceModel.dll&Key=AsyncCallbackException ---> System.Reflection.TargetInvocationException: [Async_ExceptionOccurred]
Arguments:
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See
http://go.microsoft.com/fwlink/?linkid=106663&Version=2.0.30226.2&File=System.dll&Key=Async_ExceptionOccurred ---> System.ServiceModel.ProtocolException: [UnexpectedHttpResponseCode]
Arguments:Not Found
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See
http://go.microsoft.com/fwlink/?linkid=106663&Version=2.0.30226.2&File=System.ServiceModel.dll&Key=UnexpectedHttpResponseCode
   at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
   at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result)
   at Project_Dolmen_SL_BO.CategoryServiceReference.CategoryServiceClient.CategoryServiceClientChannel.EndGetCategories(IAsyncResult result)
   at Project_Dolmen_SL_BO.CategoryServiceReference.CategoryServiceClient.Project_Dolmen_SL_BO.CategoryServiceReference.ICategoryService.EndGetCategories(IAsyncResult result)
   at Project_Dolmen_SL_BO.CategoryServiceReference.CategoryServiceClient.OnEndGetCategories(IAsyncResult result)
   at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
   --- End of inner exception stack trace ---
   at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
   at Project_Dolmen_SL_BO.CategoryServiceReference.GetCategoriesCompletedEventArgs.get_Result()
   at Project_Dolmen_SL_BO.Controller.SilverlightController.client_GetCategoriesCompleted(Object sender, GetCategoriesCompletedEventArgs e)
   at Project_Dolmen_SL_BO.CategoryServiceReference.CategoryServiceClient.OnGetCategoriesCompleted(Object state)
   at System.ServiceModel.ClientBase`1.AsyncOperation.Post(SendOrPostCallback d, Object arg)
   at System.ServiceModel.ClientBase`1.AsyncOperation.PostOperationCompleted(SendOrPostCallback d, Object arg)
   at System.ServiceModel.ClientBase`1.CompleteAsyncCall(AsyncOperationContext context, Object[] results, Exception error)
   at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
   at System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously)
   --- End of inner exception stack trace ---
   at System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously)
   at System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously, Exception exception)
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.CallComplete(Boolean completedSynchronously, Exception exception)
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.FinishSend(IAsyncResult result, Boolean completedSynchronously)
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.SendCallback(IAsyncResult result)
   at System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously)
   --- End of inner exception stack trace ---
   at System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously)
   at System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously, Exception exception)
   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.OnGetResponse(IAsyncResult result)
   at System.Net.BrowserHttpWebRequest.Failed(Object sender, EventArgs e)
   at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)

Mavaho

Joined on 04-17-2008
Posts 5
05-11-2008 10:54 PM
Re: WCF service AsyncCallbackException

Hi:

  This article describes what's cross domain and how to work it around:

http://msdn2.microsoft.com/en-us/library/cc197955(VS.95).aspx

  Basically you can either make the page hosting the Silverlight application and the WCF in the same domain or use a cross-domain policy.

Regards

Sincerely,
Allen Chen
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Allen Chen – MSFT

Joined on 03-16-2007
Posts 717
05-13-2008 4:16 AM
Marked as Answer
Re: Re: WCF service AsyncCallbackException

After some trial and error and with the help of the tool Web Development Helper I found that the problem was a connection error to the sql database.  I've used Windows Authentication and when my service tried to contact the database, it crashed.  After adding some rights to me on the server, everything worked like a charm.

 Thanks anyway

Mavaho

Joined on 04-17-2008
Posts 5