【转】WebService第一次调用正常,第二次调用超时的解决办法。
http://topic.csdn.net/t/20051116/15/4397547.html
在你的c#.net windows应用程序所参照的webservice的Reference.cs文件中,添加下列代码
using System.Net;
protected override WebRequest GetWebRequest(Uri uri)
{
HttpWebRequest webRequest = (HttpWebRequest)base.GetWebRequest(uri);
webRequest.KeepAlive = false;
webRequest.ProtocolVersion = HttpVersion.Version10;
return webRequest;
}
在你的c#.net windows应用程序所参照的webservice的Reference.cs文件中,添加下列代码
using System.Net;
protected override WebRequest GetWebRequest(Uri uri)
{
HttpWebRequest webRequest = (HttpWebRequest)base.GetWebRequest(uri);
webRequest.KeepAlive = false;
webRequest.ProtocolVersion = HttpVersion.Version10;
return webRequest;
}
-----------------------------------
http://www.cnblogs.com/rock_chen/