在我的應用程序中調用WCF服務在一分鐘後拋出EndpointNotFoundException。所有超時都超過一分鐘。Windows Phone 7在一分鐘後拋出EndpointNotFoundException
var binding = new BasicHttpBinding {
OpenTimeout = TimeSpan.FromMinutes(3),
CloseTimeout = TimeSpan.FromMinutes(6),
ReceiveTimeout = TimeSpan.FromMinutes(2),
SendTimeout = TimeSpan.FromMinutes(5)
};
client = new ServiceClient(binding, new EndpointAddress("http://..."));
client.InnerChannel.OperationTimeout = TimeSpan.FromMinutes(4);
我發現了微軟的論壇上線,但沒有解決方案。 http://social.msdn.microsoft.com/Forums/ar/windowsphone7series/thread/cba9c633-6d79-4c04-8c08-cd0b5b33d8c6
該問題僅在服務運行超過一分鐘時纔會發生。這項服務的 調用拋出EndpointNotFoundException:
public string Test() {
Thread.Sleep(60000);
return "test";
}
但這項服務的調用正常工作:
public string Test() {
Thread.Sleep(58000);
return "test";
}
有訪問網絡。只有服務運行超過一分鐘纔會出現問題。 正確調用PC服務。 – 2012-01-05 09:43:07