It seems never finish. BTW, the web service is ok in web app calling using the method waithandle. The following code is in windows application.
*********************************************
private void button2_Click(object sender, System.EventArgs e)
{
WindowsApplication1.SycAsyc.SycAsyc webAsyc=new WindowsApplication1.SycAsyc.SycAsyc();
AsyncCallback cb= new AsyncCallback(ServiceCallback);
IAsyncResult ar=webAsyc.BeginGetFile("asyc", cb, webAsyc);
while (ar.IsCompleted == false)
{ textBox1.Text="wait";
}
}
public void ServiceCallback(IAsyncResult ar)
{WindowsApplication1.SycAsyc.SycAsyc webAsyc = (WindowsApplication1.SycAsyc.SycAsyc) ar.AsyncState;
textBox1.Text = webAsyc.EndGetFile(ar);
}
*********************************************
private void button2_Click(object sender, System.EventArgs e)
{
WindowsApplication1.SycAsyc.SycAsyc webAsyc=new WindowsApplication1.SycAsyc.SycAsyc();
AsyncCallback cb= new AsyncCallback(ServiceCallback);
IAsyncResult ar=webAsyc.BeginGetFile("asyc", cb, webAsyc);
while (ar.IsCompleted == false)
{ textBox1.Text="wait";
}
}
public void ServiceCallback(IAsyncResult ar)
{WindowsApplication1.SycAsyc.SycAsyc webAsyc = (WindowsApplication1.SycAsyc.SycAsyc) ar.AsyncState;
textBox1.Text = webAsyc.EndGetFile(ar);
}