Locked Asynchronous method AsyncCallback not working

  • Monday, February 20, 2012 10:43 AM
     
      Has Code

    Hi.

       I have a windows form that calls asynchronous methods, I think there is a problem with the AsyncCallback method "GetAccountNamesComplete" (it is not being executed), I am suspecting user permission or other related issues, I tried to run it pointing a dev environment server where web service was deployed. When it is pointed to prod environment server, the method is being executed, but I am getting a Http 403 error. How can I determine what or where exactly is the problem? Is there a tool that could determine this? What are areas that I could check (possible reasons why first issue occurs - callback method not being executed)? There is no error being triggered.

    Thanks in advanced.

    private void LoginForm_Load(object sender, System.EventArgs e)
            {
                nFailures = 0;
                           
                WebServices.MyReportingService svc = AppHelper.GetWebServiceObject();
                AsyncCallback callback = new AsyncCallback(GetAccountNamesComplete);
               
                svc.BeginGetAccountNames(callback, svc);
    }
    
    private void GetAccountNamesComplete(IAsyncResult ar)
            {
    
                WebServices.MyReportingService svc = ar.AsyncState
                        as WebServices.MyReportingService;
                string[] accounts = svc.EndGetAccountNames(ar);
                this.Invoke(new UpdateAccountDelegate(UpdateAccountNames),
                    new object[] { accounts });
            }

      

    • Moved by Leo Liu - MSFT Thursday, February 23, 2012 9:50 AM Moved for better support. (From:Visual C# General)
    •  

All Replies

  • Friday, February 24, 2012 2:39 PM
    Moderator
     
     

    If you call svc.EndGetAccountNames, then any exception should be thrown at the point where you call it.

    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects

  • Friday, March 02, 2012 12:08 PM
     
     
    in my case, no exception was thrown... i think this is a missing/wrong permission.... need tool to determine where went wrong or what is missing...