0

我的 Windows Azure 项目 (c#) 中有一个奇怪的问题

我的 C# Azure 应用程序使用 Exchange 托管 API 通过 Web 与 Exchange 2010 服务器进行通信。

Exchange 2010 本身在 Azure VM 中运行。我已经打开了防火墙,以便 Exchange EWS 网络服务在端口 443 上可用。

在 Azure 模拟器中本地运行时,我的应用程序运行良好。我可以看到我帐户中的所有文件夹和电子邮件。它可以通过 Web 与 Exchange VM 完美通信。

但是,一旦我将我的应用程序发布到我的暂存环境,该应用程序就无法正常工作。

对服务器的第一次调用有效,但之后,我收到此消息:

“连接尝试失败,因为连接方在一段时间后没有正确响应,或者建立连接失败,因为连接的主机没有响应 [IPADDRESS]:443”

正如我所说,它第一次工作(我的索引页面出现了我需要的内容)但是如果我刷新那个页面,它就会给我那个错误。

因此,我不认为这是一个防火墙问题,否则它不会在第一次工作。

这让我感到绝望——我看不出有什么问题!

希望你能帮忙,

西蒙。

[编辑] 这是堆栈跟踪:

[SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond]
   System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult) +136

[IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.]
   System.Net.Security._SslStream.EndRead(IAsyncResult asyncResult) +7911429
   System.Net.TlsStream.EndRead(IAsyncResult asyncResult) +2691856
   System.Net.Connection.ReadCallback(IAsyncResult asyncResult) +79

[WebException: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.]
   System.Net.HttpWebRequest.GetResponse() +7864676
   Microsoft.Exchange.WebServices.Data.ServiceRequestBase.GetEwsHttpWebResponse(HttpWebRequest request) +130

[ServiceRequestException: The request failed. The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.]
   Microsoft.Exchange.WebServices.Data.ServiceRequestBase.GetEwsHttpWebResponse(HttpWebRequest request) +447
   Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ValidateAndEmitRequest(HttpWebRequest& request) +647
   Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute() +72
   Microsoft.Exchange.WebServices.Data.ExchangeService.BindToFolder(FolderId folderId, PropertySet propertySet) +201
   Microsoft.Exchange.WebServices.Data.CalendarFolder.Bind(ExchangeService service, WellKnownFolderName name) +83
4

1 回答 1

0

我创建了第二个云服务并将我的应用程序部署到生产环境和暂存环境。该应用程序可以完美运行!

所以我的理论是,出于某种原因,Exchange Web 服务基于 IP 地址阻止了我的暂存应用程序。但是没有防火墙规则!

好的,所以,这并不能真正回答“为什么”或“发生了什么”,但这是我要使用的解决方案:

从 Azure 中删除云应用并重新完全部署!

这具有生成新 IP 地址的效果,突然我的暂存区再次工作。

抱歉,我想不出更好的办法,但解决方案就是解决方案。

于 2012-09-15T22:47:48.737 回答