ruby-on-railsrubyweb-servicessharepointsoap4r

Ruby/Rails and Sharepoint Web Services


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?


Solution

  • 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

    agent = Mechanize.new
    agent.auth('domain\\USERNAME', 'PASSWORD')
    page = agent.get('http://URL/DIRECTORY/SITE/LIST/_vti_bin/owssvr.dll?Cmd=Display&List={LIST_GUID}&View={VIEW_GUID}&XMLDATA=TRUE')