Koteswararao Mallisetti

Koteswararao Mallisetti

  • NA
  • 1.1k
  • 467.9k

system.servicemodel.protocolexception

Oct 11 2010 10:03 AM
i am using the page asynchronousTask to call the wcf service which is reside in another project in same solution for that i am using following code
protected void Button1_Click(object sender, EventArgs e)
    {
        PageAsyncTask pat = new PageAsyncTask(BeginDoWork, EndDoWork, null, null);
        Page.RegisterAsyncTask(pat);
        //Page.ExecuteRegisteredAsyncTasks();
    }  
 
    IAsyncResult BeginDoWork(object sender, EventArgs e, AsyncCallback acb, object extraData)
    {
         nor = new ServiceReference1.Service2Client();
        return nor.BeginDoWork(acb  ,extraData );//first null value is any call back method
        //return nor.BeginProductList(acb, extraData);
    }
 
    void EndDoWork(IAsyncResult ar)
    {
         nor.EndDoWork(ar);
    }

but in the endDoWork method it will show the following error

system.servicemodel.protocolexception was unhandled by user code

what is the problem with my code.

Answers (2)