Ruby/Rails 和 Sharepoint Web 服务
我正在尝试使用 ruby 来使用 Sharepoint Web 服务。 我基本上放弃了尝试使用 NTLM 进行身份验证,并暂时将 Sharepoint 服务器更改为使用基本身份验证。 我已经使用soap4r 成功获取了WSDL,但在尝试使用实际的Web 服务调用时仍然无法进行身份验证。
有人有过让 ruby 和 Sharepoint 对话的经验吗?
I'm trying to consume Sharepoint webservices with ruby. I've basically given up trying to authenticate with NTLM and temporarily changed the Sharepoint server to use basic authentication. I've been successful getting a WSDL using soap4r but still cannot authenticate when attempting to use an actual web service call.
Has anyone had any experience getting ruby and Sharepoint to talk?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我完全是个新手。 但经过很多时间并在更有经验的编码人员的帮助下,我能够让 ruby 与 Sharepoint 2010 一起工作。下面的代码需要“ntlm/mechanize”gem。
我已经能够使用列表 GUID 和列表视图 GUID 从指定的列表(如下)下载 sharepoint xml。
编辑(2011 年 5 月 23 日)。 我应该指出这个代码需要 ruby-ntlm gem。 这是一个不错的链接,应该会有所帮助。 这绝对有效。
http://rubydoc.info/gems/ruby-ntlm/0.0 .1/file/README.markdown
I'm a total newb. But after a lot of time and with some help from more experience coders, I was able to get ruby working with Sharepoint 2010. The code below requires the 'ntlm/mechanize' gem.
I've been able to download the sharepoint xml from lists specified (below) using the List GUID and the List View GUID.
Edit (May 23, 2011). I should have pointed out that this code requires the ruby-ntlm gem. Here's a decent link that should help. This definitely works.
http://rubydoc.info/gems/ruby-ntlm/0.0.1/file/README.markdown
如何更改 SP 服务器以使用基本身份验证? 您是刚刚通过 IIS 配置站点,还是通过 SP Central Admin 进行配置?
如果您使用的是 SP 2007/MOSS,则需要通过 Central Admin 进行更改; 如果是 2003,则需要通过 IIS 来完成。
请求失败时会出现什么错误?
How did you change the SP server to use Basic Auth? Did you just configure the site via IIS, or did you do it through SP Central Admin?
If you're using SP 2007/MOSS, you need to change it via Central Admin; if 2003, you need to do it via IIS.
What error do you get when the request fails?
SOA4R 不支持 NTLM,尽管 httpclient 支持它。
当无法启用基本身份验证时,您可以考虑使用 kerberos,即协商身份验证方法。 在共享点中启用此功能有点棘手,但基本上可以归结为在服务器的命令行上执行以下操作:
它似乎可能有一些奇怪的结果,查看此论坛帖子了解更多信息。
最后你需要在soap4r中使用 auth= 设置身份验证,而不是我认为的 basic_auth= 。
NTLM is not supported by soap4r somehow, eventhough httpclient does support it.
When enabling basic auth is not an option, you could consider using kerberos i.e. negotiate auth method. Enabling this in sharepoint is a bit tricky, but basically comes down to doing the following on the commandline of the server:
It might have some wird concequences it seems, check this forum post for more info.
Finally you need to set the authentication in soap4r with auth= instead of basic_auth= i think.
这可能没有帮助,但微软刚刚发布了 Sharepoint 和 WSRP 工具包,http://blogs.msdn.com/sharepoint/archive/2008/12/15/announcing-the-wsrp-toolkit-for-sharepoint.aspx,自RoR 支持该标准,它可以提供一种更简单的获取数据的方法。
This may not help but micorosoft just release the toolkit for Sharepoint and WSRP, http://blogs.msdn.com/sharepoint/archive/2008/12/15/announcing-the-wsrp-toolkit-for-sharepoint.aspx, since RoR supports that standard it may provide an easier method of getting the data.