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
  • 相关阅读:
    Windows下 Mysql忘记密码的修改方法
    java 多文件压缩下载
    MySQL配置文件中jdbc.url
    java实现excle文件上传,解析
    MySQL事务
    重拾MySQL
    Linux中修改MySql配置文件
    Freemarker模板引擎
    过滤器、监听器、拦截器
    XML基础
  • 原文地址:https://www.cnblogs.com/zuike/p/3070784.html
Copyright © 2011-2022 走看看