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
  • 相关阅读:
    LOAD XML
    LOAD DATA
    INSERT 插入语句
    keras第一课
    android系统开发之开启启动
    Qt使用数据库
    微信订阅号案例之一
    python_install
    QtObject使用
    Qml_JS文件的使用
  • 原文地址:https://www.cnblogs.com/zuike/p/3070784.html
Copyright © 2011-2022 走看看