calling a methos through webservice

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vineetbindal
    New Member
    • Jan 2009
    • 57

    calling a methos through webservice

    Hi,

    I have a webservice which i am calling on button click event.

    this webservice is serving twi methods, my problem is that allthough this service will call both the methods but one of them sometimes does not run i cant understant why?
    Code:
            void Page_Loaded(object sender, RoutedEventArgs e)
            {
                Search.Click += new RoutedEventHandler(Search_Click);
                
            }
    
            void Search_Click(object sender, RoutedEventArgs e)
            {
                ServiceReference1.Service1Client webService = new SQLData.ServiceReference1.Service1Client();
                webService.DocStatusListCompleted += new EventHandler<SQLData.ServiceReference1.DocStatusListCompletedEventArgs>(webService_GetStatus);
                webService.DocStatusListAsync();
                [B]System.Diagnostics.Debug.WriteLine("calledstatuslist");[/B]           
                
                webService.DocWorkFlowCompleted += new EventHandler<SQLData.ServiceReference1.DocWorkFlowCompletedEventArgs>(webService_GetUsers);
                webService.DocWorkFlowAsync(User.Text);
               
                
           
            }
    
           void webService_GetStatus(object sender, SQLData.ServiceReference1.DocStatusListCompletedEventArgs e)
            {
                [B]System.Diagnostics.Debug.WriteLine("gettingstatuslist" );
           
                 [/B]DocStatusList = e.Result;
                System.Diagnostics.Debug.WriteLine("statuslist" + DocStatusList.Count());
                  
            }
            
            void webService_GetUsers(object sender, SQLData.ServiceReference1.DocWorkFlowCompletedEventArgs e)
            {
                DocWorkFlowList = e.Result;
    //other stuff use DocStatusList public variable here... and sometimes it works and sometimes it throws error showing that list is empty becouse that method above does not get called
    }
    now in the output i can see line printed calledstatuslis t but allthough i has run the code for that method. that method never get called. and my statuslist is empty..

    why is it happening..plea se help
Working...