如果你通过Winform程序调用WebService时收到以下异常:
System.Net.WebException: The operation has timed-out.
可以尝试在Reference.cs里添加:
protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
System.Net.HttpWebRequest webRequest =
(System.Net.HttpWebRequest) base.GetWebRequest(uri);
webRequest.KeepAlive = false;
return webRequest;
}
来解决。
System.Net.WebException: The operation has timed-out.
可以尝试在Reference.cs里添加:
protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
System.Net.HttpWebRequest webRequest =
(System.Net.HttpWebRequest) base.GetWebRequest(uri);
webRequest.KeepAlive = false;
return webRequest;
}
来解决。