无法从 Sharepoint 自动发现 Exchange

发布于 2024-10-14 10:13:16 字数 1185 浏览 8 评论 0原文

我创建了一个在 Sharepoint 中使用的 ascx 控件,该控件通过其 Web 服务访问 Exchange 2010。当在它自己的 ASP.NET 测试站点(包装在一个简单的 aspx 页面中)中运行时,一切正常。一旦在 Sharepoint 中使用该控件,就会遇到“无法找到自动发现服务”错误。

ascx 控件的 dll 背后的代码已放入 GAC 中,并且 Microsoft.Exchange.WebServices.dll

Microsoft.Exchange.WebServices.dll 也已添加到共享点站点的 web.config 中的安全控件列表中

<SafeControl Assembly="Microsoft.Exchange.WebServices, Version=14.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="Microsoft.Exchange.WebServices" TypeName="*" Safe="True" />

:可以 ping 自动发现服务并访问 Exchange Web 服务 URL https://mydomain.com/EWS/Services.wsdl 来自 Sharepoint 服务器。

用户名和密码正在 ascx 后面的代码中发送到服务:

Dim service As ExchangeService = New ExchangeService()
service.Credentials = New WebCredentials(usrExchange, pwdExchange)
service.ImpersonatedUserId = New ImpersonatedUserId(ConnectingIdType.SmtpAddress, email)

有趣的是,如果我指定 url https: //mydomain.com/EWS/Exchange.asmx 到服务我收到 405 Method not allowed 错误。

任何人都知道问题可能是什么?

干杯, 加文

I've created an ascx control for use in Sharepoint that accesses Exchange 2010 via it's web services. When run in it's own ASP.NET test site (wrapped in a simple aspx page) all works fine. As soon as the control is used within Sharepoint a "The Autodiscover service couldn't be located" error is encountered.

The code behind dll for the ascx control has been dropped in to the GAC and also Microsoft.Exchange.WebServices.dll

Microsoft.Exchange.WebServices.dll has also been added to the safe control list in web.config for the sharepoint site:

<SafeControl Assembly="Microsoft.Exchange.WebServices, Version=14.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="Microsoft.Exchange.WebServices" TypeName="*" Safe="True" />

I can ping the autodiscovery service and access the Exchange web service url https://mydomain.com/EWS/Services.wsdl from the Sharepoint server.

A username and password is being sent to the service in the ascx's code behind:

Dim service As ExchangeService = New ExchangeService()
service.Credentials = New WebCredentials(usrExchange, pwdExchange)
service.ImpersonatedUserId = New ImpersonatedUserId(ConnectingIdType.SmtpAddress, email)

Interestingly, if I specify the url https://mydomain.com/EWS/Exchange.asmx to the service I get a 405 Method not allowed error.

Anyone have any ideas what the issue might be?

Cheers,
Gavin

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一花一树开 2024-10-21 10:13:16

我遇到了同样的问题,我想我已经找到了解决方案。我必须将交换服务器使用的域根证书添加到“管理信任”下的 SharePoint。

在那之后,一切都变得很神奇!

I've encountered the same problem and I think I've found the solution. I had to add the domain root certificate which was used by the exchange server to the SharePoint under "Manage Trust".

After that everything worked like a charm!

以往的大感动 2024-10-21 10:13:16

ascx 控件可以作为运行 SharePoint 的帐户来执行 Web 服务调用。该帐户可能无权访问 Exchange Web 服务。

The ascx control could be executing the web service call as the account that is running SharePoint. That account may not have access to the Exchange web service.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文