无法从 Sharepoint 自动发现 Exchange
我创建了一个在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了同样的问题,我想我已经找到了解决方案。我必须将交换服务器使用的域根证书添加到“管理信任”下的 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!
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.