문제

If I want to develop an application in .Net using C# which will perform simple operations such as:

  1. Connect to a site using user/password
  2. Retrieve document libraries
  3. Upload file in document library

What do you think should be the approach keeping in mind compatibility i.e. the application will work on SharePoint 2007, 2010 and 2013?

도움이 되었습니까?

해결책

CSOM and REST was introduced in SP 2010 so you wont be able to use that with 2007.

SOM is an option but requires that your code runs on the servers of each farm.

SharePoint Web Services will be your best option if you need to support all three versions with the same code from client computers.

Lists Web Service (/_vti_bin/Lists.asmx) for getting libraries

HTTP PUT or Copy Web Service (/_vti_bin/Copy.asmx) to upload document

다른 팁

  • CSOM: will work in SP online, SP 2010, 2013 and most probably 2016
  • REST: will work in SP online, SP 2010, 2013 and most probably 2016
  • OOTB Web service: will work in SP 2007, 2010, 2013 but maybe not in 2016 (and maybe not with future versions of SP online)
  • Creating your own Web service with SOM: will work in SP 2007, 2010, 2013 and 2016

The client object model was created in 2010. CSOM did not exist in 2007. So I would recommend the server object model.

I think, SOM is better option for doing complex operation in SharePoint. Becuase if you use REST/ CSOM, internally it will call some service which will get some time to execute that query than SOM on the server. so better to use SOM which will directly hit the server for operation.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top