Recently I am developing a webservice which is used to upload document to a SharePoint doc library. I have deploy it to the _vti_bin directory and now I can successfully call it to upload a document. However, no matter what I use as username and password, the owner of upload document is still System Account. It shows in the site as modified by System Account. I refer to "Walkthrough: Creating a Custom ASP.NET Web Service (Eng version)" to develop and deploy webservice. The code for calling the webservice is the following:
string FileUrl = "d:/bbb.txt";
sharepoint_0907.Service ss = new sharepoint_0907.Service();
ss.Credentials = new NetworkCredential(username, password, domain);
byte[] fileContents = System.IO.File.ReadAllBytes(@FileUrl);
int s = ss.UploadFile("http://sharepoint01/Shared Documents/",
fileContents, "http://sharepoint01", "123.txt");
string ddd = ss.HelloWorld();
So I can successfully upload a document with view user who has not have authority to upload a document. And this is not what I want. Can anyone help me with this?