jam*_*rio 3 .net c# exchange-server exchangewebservices
我目前正在解决与Exchange Web服务相关的问题.问题是,在打开与流式订阅的连接(通过StreamingSubscriptionConnection对象)时,操作在调用Open方法时挂起.以下是挂起的代码,供参考:
_streamingSubscriptionConnection = new StreamingSubscriptionConnection(_exchangeService, _connectionLifetime);
_streamingSubscriptionConnection.AddSubscription(_subscription);
_streamingSubscriptionConnection.OnNotificationEvent += new StreamingSubscriptionConnection.NotificationEventDelegate(OnNotificationEvent);
_streamingSubscriptionConnection.OnSubscriptionError += new StreamingSubscriptionConnection.SubscriptionErrorDelegate(OnSubscriptionError);
_streamingSubscriptionConnection.OnDisconnect += new StreamingSubscriptionConnection.SubscriptionErrorDelegate(OnDisconnect);
_streamingSubscriptionConnection.Open();
Run Code Online (Sandbox Code Playgroud)
它通常需要大约两分钟,然后抛出一个ServiceRequestException消息是:
请求失败了.操作已超时.
值得一提的是,即使我将超时设置为一分钟,它仍然需要超过一分钟然后抛出此异常.该呼叫永远不会超过该Open命令.
我的问题是,过去有没有人遇到过这个问题?此外,是否有任何可用的工具可用于诊断任何连接问题,以确定异常是在我的端,Exchange服务器端,还是中间的某个地方?我已经尝试过Fiddler和Microsoft网络监视器来寻找任何模式,但我很难辨别任何东西.
提前致谢!
编辑:要添加到此,如果我添加跟踪侦听器,我会得到相当多的输出.我可以看到它检索订阅ID,然后尝试连接.当它发出连接请求时,这是在发出Open命令和超时之间记录的内容:
<Trace Tag="EwsRequestHttpHeaders" Tid="10" Time="2013-01-24 19:16:18Z">
POST /ews/exchange.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
Accept: text/xml
User-Agent: ExchangeServicesClient/14.03.0032.000
Accept-Encoding: gzip,deflate
</Trace>
<Trace Tag="EwsRequest" Tid="10" Time="2013-01-24 19:16:18Z" Version="14.03.0032.000">
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2010_SP1" />
</soap:Header>
<soap:Body>
<m:GetStreamingEvents>
<m:SubscriptionIds>
<t:SubscriptionId>GABsdGNmaXN3bXNnY2EwNi5mbmZpcy5jb20QAAAAnQCowdNSt0iTEhqVr8+a1GPHu2t+yM8I</t:SubscriptionId>
</m:SubscriptionIds>
<m:ConnectionTimeout>30</m:ConnectionTimeout>
</m:GetStreamingEvents>
</soap:Body>
</soap:Envelope>
</Trace>
Run Code Online (Sandbox Code Playgroud)
我试图排除网络问题,但是有点困难.此时欢迎任何建议.
对于那些追随我的人来说,这个问题与.Net或EWS库无关.
问题最终与我们公司负载均衡器的持久性设置有关.使用我们的负载平衡器,如果为EWS流订阅调用启用了任何类型的持久性,那么这些连接将失败.不幸的是,当时我不知道自己和Exchange服务器之间存在负载均衡器,因为开发人员无法访问该基础结构.
无论如何,希望这有助于将来的某个人!
| 归档时间: |
|
| 查看次数: |
2120 次 |
| 最近记录: |