有支排程透過Microsoft Exchange Web Service Managed API 2.0存取Exchange Web Service收發信及讀取公用資料夾,執行時需指定Exchage.asmx URL方能運作。程式每日執行,多年無事,卻在手頭專案烽火連天的某個早上爆開,彈出錯誤訊息:

Microsoft.Exchange.WebServices.Data.ServiceResponseException: Client Access Server 版本不符合所存取之資源的信箱伺服器版本。請使用自動探索與所要存取之資源的位址,判定用以存取特定資源的正確 URL。

Microsoft.Exchange.WebServices.Data.ServiceResponseException: The Client Access server version doesn't match the Mailbox server version of the resource that was being accessed. To determine the correct URL to use to access the resource, use Autodiscover with the address of the resourc

推測是公司近期升級Exchange的副作用,一時問不到正確新址又急著解決問題,爬文自力救濟。stockoverflow討論提到Autodiscover做法,下載Microsoft Exchange Server 2010 SP2 Web Services SDK September 2011,編譯C:\Program Files (x86)\Microsoft\Exchange Server 2010 SP2\Web Services SDK September 2011\Samples\Autodiscover\AutodiscoverSample專案,不知是否公司的AD網域環境特殊還是有我疏漏的環節,半點資訊都沒查到,失敗收場。

所幸在另一篇文章找到好方法:

1.在Outlook圖示上按Ctrl+滑鼠右鍵叫出選單

2.輸入電子郵件地址及密碼,按下測試:

在可用性服務URL欄位可查到Exchange.asm的網址,改用新址,EWS程式總算復活。


Comments

Be the first to post a comment

Post a comment