本文介绍了带有Exchange 2007 SP2汇总1的EWS API 1.0存在问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 最后一个DEC 2009年我们从Exchange 2003升级到Exchange 2007 SP1汇总9并在同一时间时间用EWSAPI代码替换我们现有的基于WebDAV的代码。在我们升级到Exchange 2007 SP2汇总1之前,一切都很好。在此次升级之后,我们的代码停止工作并开始抛出以下异常: 错误代码: Microsoft.Exchange.WebServices.Data.ServiceError.ErrorNoDestinationCASDueToVersionMismatch 错误消息:访问资源的帐户必须与要访问的代理帐户位于同一邮箱服务器版本上。 &nb sp; 以下是代码我们正在使用的示例代码和程序在RED行崩溃 Dim service As New ExchangeService(ExchangeVersion.Exchange2007_SP1) service.Credentials =新的WebCredentials(sUserName,sPassword,sDomain) service.Url =新System.Uri(sWebServiceUrl) Dim mailBox As New邮箱(sMailBoxaddress) Dim oInboxFolderID As FolderId = New FolderId(WellKnownFolderName.Inbox,mailBox) Dim iItemView As New ItemView(100)  ;     Dim hashMails As New Hashtable Dim fl As SearchFilter.SearchFilterCollection = Nothing 如果alExcludeFrom.Count> 0然后 fl = New SearchFilter.SearchFilterCollection(LogicalOperator.And) 对于每个sToBeExcludeEmail As String in alExcludeFrom       fl.Add(New SearchFilter.IsNotEqualTo(EmailMessageSchema.From,sToBeExcludeEmail)) 下一步 结束如果 Dim findItemResult As FindItemsResults(Of Item)= service.FindItems(oSourceFolderID,fl,iItemView)   ; 我试过使用bethout ExchangeVersion.Exchange2007_SP1参数然后我收到错误说: "Exchange服务器不支持请求的版本。" 请帮忙。 问候 Manoj 解决方案 请将所有CAS服务器更新为SP2 RU1。 EWS不支持跨版本请求,这就是您收到此错误的原因。您正在使用的CAS是SP2 RU1,但是可以检索目标邮箱信息的CAS不是。 Hi,Last moth DEC 2009 we upgraded from exchange 2003 to Exchange 2007 SP1 rollup 9 and at the same time replace all our existing WebDAV based code by EWSAPI codes. Everything was fine till last week when we upgraded to Exchange 2007 SP2 Rollup 1. After this upgrade our code stopped working and start throwing following exception: Error Code: Microsoft.Exchange.WebServices.Data.ServiceError.ErrorNoDestinationCASDueToVersionMismatchError Message: The account accessing the resource must be on the same Mailbox Server version as the delegate account being accessed. Following is the code sample code we are using and program crashes at RED line Dim service As New ExchangeService(ExchangeVersion.Exchange2007_SP1)service.Credentials = New WebCredentials(sUserName, sPassword, sDomain)service.Url = New System.Uri(sWebServiceUrl) Dim mailBox As New Mailbox(sMailBoxaddress)Dim oInboxFolderID As FolderId = New FolderId(WellKnownFolderName.Inbox, mailBox) Dim iItemView As New ItemView(100) Dim hashMails As New Hashtable Dim fl As SearchFilter.SearchFilterCollection = NothingIf alExcludeFrom.Count > 0 Thenfl = New SearchFilter.SearchFilterCollection(LogicalOperator.And) For Each sToBeExcludeEmail As String In alExcludeFrom fl.Add(New SearchFilter.IsNotEqualTo(EmailMessageSchema.From, sToBeExcludeEmail)) NextEnd IfDim findItemResult As FindItemsResults(Of Item) = service.FindItems(oSourceFolderID, fl, iItemView) I have tried bethout using ExchangeVersion.Exchange2007_SP1 parameter but then I receive error saying:"Exchange server doesn't support requested version." Please help. RegardsManoj 解决方案 Please update all your CAS servers to SP2 RU1. EWS does not support cross-version requests, which is why you are getting this error. The CAS you are hitting is SP2 RU1 but the CAS that can retrieve the information for the targeted mailbox is not. 这篇关于带有Exchange 2007 SP2汇总1的EWS API 1.0存在问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 07-23 19:18