2

I would like to upload some files on a server Share Point. My questions are:

1) I started developing my project as a Windows Service but I read several parts of this WebService. It's mandatory that it's be a WebService?

2) I added the references to. Dll take it from my SharePoint Server (as seen in most discussions) but a little read more shares can not be tested if not solely on where you installed SharePoint Server. Right or there are alternative methods to do this? And also, when we deliver the service, can I install the latter on a machine where SharePoint is not installed (it seems a trivial question, but it seems strange not being able to test but you install it).

Luigi Saggese
  • 5,299
  • 3
  • 43
  • 94

1 Answers1

2

You can only reference SharePoint 2007 assemblies from code that is running on the machine where SharePoint is installed (if you were using SharePoint 2010, you could take advantage of the Client Object Model).

Only the part of your solution that is directly interacting with SharePoint has to be created as a web service. You should create a web service with basic methods like UploadFileToLibrary, deploy it to SharePoint machine and then call these methods from the client (it can be an ASP.NET page or desktop application).


As Kit Menke pointed out in a comment below, it is possible that built-in SharePoint web services will be sufficient for you needs and you won't have to create a custom one:

Community
  • 1
  • 1
Marek Grzenkowicz
  • 17,024
  • 9
  • 81
  • 111
  • Ok let's see if I understand correctly. I must project a service having a method that is exposed to the web and install it on SharePoint server. Expose a client-side interface that invokes the web server and sending it the data stream received as input. Client: interface to upload file. Server: Web method that receives the data stream and deposits it locally. Right? – Luigi Saggese Nov 08 '10 at 13:35
  • 1
    Why are you creating a Web Service? There is no need to create a method for uploading documents since they already exist... for example: http://stackoverflow.com/questions/31868/upload-a-file-to-sharepoint-through-the-built-in-web-services – Kit Menke Nov 08 '10 at 14:06
  • Because files are in a machine different located from server where is installed SharePoint – Luigi Saggese Nov 08 '10 at 14:19
  • 1
    Files that i want to upload are in a different pc that is not in the same LAN. For understanding on LUIGI PC there are some files that want to be upload on MAREK PC (server Share Point) by web connection. – Luigi Saggese Nov 08 '10 at 16:04
  • Luigi: Either the web services (http://stackoverflow.com/questions/31868/upload-a-file-to-sharepoint-through-the-built-in-web-services/34274#34274) or a simple PUT WebRequest (http://stackoverflow.com/questions/31868/upload-a-file-to-sharepoint-through-the-built-in-web-services/44915#44915) should work. – Kit Menke Nov 09 '10 at 14:39
  • Thanks a lot Marek, i'm going in another direction by use DavCopy.exe. – Luigi Saggese Nov 09 '10 at 14:49