无法找到Exchange Webservice自动发现服务

时间:2016-11-16 18:46:36

标签: c# visual-studio email exchange-server exchangewebservices

我有这段代码

ExchangeService serviceInstance;
            serviceInstance = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
            serviceInstance.Credentials = new WebCredentials("Jacob.Alley", "*****", "emaildomain");
            serviceInstance.TraceEnabled = true;
            serviceInstance.AutodiscoverUrl("Jacob.Alley@emaildomain.com");

我得到了“无法找到自动发现服务”错误。 这是跟踪

`

Trying to call Autodiscover for Jacob.Alley@emaildomain.com on https://emaildomain.com/autodiscover/autodiscover.xml.
</Trace>
<Trace Tag="AutodiscoverRequestHttpHeaders" Tid="8" Time="2016-11-16 18:41:58Z"

POST /autodiscover/autodiscover.xml HTTP/1.1
Content-Type: text/xml; charset=utf-8
Accept: text/xml
User-Agent: ExchangeServicesClient/15.00.0847.030


</Trace>
<Trace Tag="AutodiscoverRequest" Tid="8" Time="2016-11-16 18:41:58Z" Version="1
.00.0847.030">
  <Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlo
k/requestschema/2006">
    <Request>
      <EMailAddress>Jacob.Alley@emaildomain.com</EMailAddress>
      <AcceptableResponseSchema>http://schemas.microsoft.com/exchange/autodisco
er/outlook/responseschema/2006a</AcceptableResponseSchema>
    </Request>
  </Autodiscover>
</Trace>
<Trace Tag="AutodiscoverConfiguration" Tid="8" Time="2016-11-16 18:41:58Z">
 failed: WebException (The underlying connection was closed: Could not establis
 trust relationship for the SSL/TLS secure channel.)
</Trace>
<Trace Tag="AutodiscoverConfiguration" Tid="8" Time="2016-11-16 18:41:58Z">
Trying to call Autodiscover for Jacob.Alley@emaildomain.com on https://autodisc
ver.emaildomain.com/autodiscover/autodiscover.xml.
</Trace>
<Trace Tag="AutodiscoverRequestHttpHeaders" Tid="8" Time="2016-11-16 18:41:58Z"

POST /autodiscover/autodiscover.xml HTTP/1.1
Content-Type: text/xml; charset=utf-8
Accept: text/xml
User-Agent: ExchangeServicesClient/15.00.0847.030


</Trace>
<Trace Tag="AutodiscoverConfiguration" Tid="8" Time="2016-11-16 18:41:58Z">
 failed: WebException (The remote name could not be resolved: 'autodiscover.emaildomain.com')
</Trace>
<Trace Tag="AutodiscoverConfiguration" Tid="8" Time="2016-11-16 18:41:58Z">
Trying to get Autodiscover redirection URL from http://autodiscover.emaildomain.com/autodiscover/autodiscover.xml.
</Trace>
<Trace Tag="AutodiscoverConfiguration" Tid="8" Time="2016-11-16 18:41:58Z">
Request error: The remote name could not be resolved: 'autodiscover.emaildomain
com'
</Trace>
<Trace Tag="AutodiscoverConfiguration" Tid="8" Time="2016-11-16 18:41:58Z">
No Autodiscover redirection URL was returned.
</Trace>
<Trace Tag="AutodiscoverConfiguration" Tid="8" Time="2016-11-16 18:41:58Z">
Trying to get Autodiscover host from DNS SRV record for emaildomain.com.
</Trace>
<Trace Tag="AutodiscoverConfiguration" Tid="8" Time="2016-11-16 18:41:58Z">
DnsQuery returned error error 'DNS name does not exist' error code 0x0000232B.
</Trace>
<Trace Tag="AutodiscoverConfiguration" Tid="8" Time="2016-11-16 18:41:58Z">
No appropriate SRV record was found.
</Trace>
<Trace Tag="AutodiscoverConfiguration" Tid="8" Time="2016-11-16 18:41:58Z">
No matching Autodiscover DNS SRV records were found.
</Trace>`

我知道我有正确的电子邮件地址/用户名/密码,但我不确定如何破译跟踪,或者是否有一些我做错了。

1 个答案:

答案 0 :(得分:0)

如果查看跟踪,似乎没有为自动发现配置任何DNS记录,例如“远程名称无法解析”

Active Directory的SCP查找成功但其尝试使用的URL与Web服务器上的SSL证书不匹配“(底层连接已关闭:无法建立SSL / TLS安全通道的信任关系“。如果这只是一个开发服务器,你可以通过使用SSL旁路来忽略该错误,如

System.Net.ServicePointManager.ServerCertificateValidationCallback +=
(se, cert, chain, sslerror) =>
    {
        return true;
    };

您可以使用https://testconnectivity.microsoft.com/

在外部测试自动发现