How can I program against SharePoint 2007 remotely in IronPython?
My current goal is to query a list on our SharePoint 2007 server from client machines (i.e., remotely), from a program, pref开发者_C百科erably written in IronPython (CPython is also fine). Can someone please provide me with an example of how this can be done? I've searched quite a bit, and I have to say it's difficult to find information other on how to program on the server, rather than remotely.
At a later stage I'll also want to edit the list, so information on how to do this as well would be very welcome :)
Since your code will be running remotely. You cannot leverage the SharePoint .NET API to gain access, so IronPython is not required.
From straight Python (or IronPython or CPython or whatever) your best route is using the SOAP-based web services to query the list in question.
The syntax is typical MS-XML, which is complex to say the least. There are a few tools on CodePlex.com (e.g., http://spdevexplorer.codeplex.com/) that can help you browse your SharePoint farm and gather the required info and take a peek at the XML syntax.
You can do a lot more than just query a list via the web services. A good list of the available services in 2007 is available here: http://blog.benfox.info/?p=69
If you're in a rush, you could also query owssvr.dll as well. This is what Office used to use for SharePoint functionality. It's still in place for 2007 and 2010 but in 2010 it's now deprecated.
Hope that helps point you in the right direction.
Mark
精彩评论