I have a .Net Proxy class that has several web service methods, each method has its Begin*Operation* and End*Operation*. I am experiencing web service requests that are getting stuck and has no response.
I am thinking of making use of the AsyncWaitHandle property of the return value of the Begin*Operation* method. I just dont know exactly where to put it.
Here is my code:
public activateResponse activateServiceReq([System.Xml.Serialization.XmlElementAttribute("activateServiceReq", Namespace = "http://AAA/BBB")] activateServiceReq activateServiceReq1)
{
object[] results = this.Invoke("activateServiceReq", new object[] { activateServiceReq1});
return ((activateServiceReqResponse)(results[0]));
}
//The Begin operation where I will use the AsyncWaitHandle.WaitOne
public System.IAsyncResult BeginactivateServiceReq(activateServiceReq activateServiceReq1, System.AsyncCallback callback, object asyncState)
{
IAsyncResult result = this.BeginInvoke("activateServiceReq", new object[] { activateServiceReq1}, callback, asyncState);
result.AsyncWaitHandle.WaitOne();
return result;
}
/// <remarks/>
public activateServiceReqResponse EndactivateServiceReq(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((activateServiceReqResponse)(results[0]));
}