zoukankan      html  css  js  c++  java
  • The Autodiscover service couldn't be located EWS API AutodiscoverUrl 报错

    使用EWS Managed API 进行邮件收取


    提示为AutodiscoverUrl处异常, The Autodiscover service couldn't be located 。

    在xp x86本地开发环境下代码没有问题,放到win2008x64上时报错,说明与程序运行环境有关。

    查阅官方文档:Getting Started with the EWS Managed API 可得知,ssl可导致这个错误出现。

    可根据官方文档添加以下代码:
    using System.Net.Security;
    using System.Security.Cryptography.X509Certificates;
    // Hook up the cert callback.
    System.Net.ServicePointManager.ServerCertificateValidationCallback =
    delegate(
    Object obj,
    X509Certificate certificate,
    X509Chain chain,
    SslPolicyErrors errors)
    {
    // Validate the certificate and return true or false as appropriate.
    // Note that it not a good practice to always return true because not
    // all certificates should be trusted.
    };



    另,一网友也碰到了此问题,并附有解决方法:http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/thread/bdc45cd8-6385-4900-9e40-23814beb7639?Thread%3Abdc45cd8-6385-4900-9e40-23814beb7639=Microsoft.Forums.Data.Models.Discussion&ThreadViewModel%3Abdc45cd8-6385-4900-9e40-23814beb7639=Microsoft.Forums.CachedViewModels.ThreadViewModel
  • 相关阅读:
    文件同步工具
    截图工具
    DBF文件工具
    Oracle旗下的开源虚拟机
    远程协助工具
    切换网络IP工具
    MySQL(C#的链接姿势)
    大写URL转小写
    一个textview实现文字在图片上面的效果
    通过代码设置textview颜色
  • 原文地址:https://www.cnblogs.com/zuike/p/3070784.html
Copyright © 2011-2022 走看看