Hello, I am trying to make async web service call from asp.net 2.0 web client to WCF web service. I created the proxy class using the svcutil.exe with the async option. Here is an example of the client code calling the web service:
protected void Page_Load(object sender, EventArgs e)
{
WSClient client = new WSClient();
AsyncCallback asyncCallback = new AsyncCallback(WebServiceCallback);
AsyncCallState asyncCallState = new AsyncCallState(client);
client.BeginWS(value, asyncCallback, asyncCallState);
Response.Write("Big Test");
}
public void WebServiceCallback(IAsyncResult ar)
{
AsyncCallState asyncCallState = (AsyncCallState)ar.AsyncState;
WSsClient client = (WSClient)asyncCallState.WebServiceState;
WSClientResult result = client.EndWS(ar);
}
Using the code for reference; everything in the Page_Load will execute but the page will not display the “Big Test” until the client.EndWS is executed in the callback. Which does not appear to be asynchronous. Any ideas or suggestions of how to make the asynchronous call asynchronous are appreciated.