SPListService and remote SharePoint Document Library

Mar 9, 2012 at 1:59 PM


I'm first in sharepoint and i don't know if this can work with a remote sharepoint.

This code work on local macchine but don't work if sharepoint library in on different PC.

I tried project library and work good on remote PWA.

Can you helpme ?




 var spSessionService = new SPSessionService();           

spSessionService.HostName = "pdell05win7";           

spSessionService.SiteName = "sites/Prova";           

using (new LoginContext("luigi", "password", spSessionService))           


var spListService = new SPListService(spSessionService);               

SPLibraryService sPLibraryService = new SPLibraryService(spListService);               

SPDocumentLibraryInfo c = sPLibraryService.Get("Documenti");               

sPLibraryService.DeleteDocument(spSessionService.SiteUrl + "Documenti/DaFare.xls");


Mar 12, 2012 at 1:16 PM



You need to use the ClientOM services implementation for remote SharePoint instances:

var spListService = new SPClientOMListService(spSessionService); 

var sPLibraryService = new SPClientOMLibraryService(spListService);


Hope this helps,