Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

Creating Document Library with C# / Webservice

  Asked By: Taylor Franklin         Date: Aug 11, 2009      Category: Sharepoint      Views: 458
 

I tried to create a Document Library by calling a self-coded
Webservice.

The Webservice looked like this:

try
{
SPWeb site = SPControl.GetContextWeb(Context);
SPSite mysite=new SPSite(url);
SPWeb s=mysite.OpenWeb();
s.Lists.Add(library, "", SPListTemplateType.DocumentLibrary);
}
catch(Exception ex)
{
//Error-Code
}

In a C#-Windows-Project, everything works fine. But now I tried to
call the Webservice within an Access-Application and within a
Console-Application (C#). Both failed with the Error "Access denied"
at the Line "s.Lists.Add(...)"

The code of the Console-Application:

sps.DocumentHandler docHandler=new sps.DocumentHandler();
docHandler.Credentials=System.Net.CredentialCache.DefaultCredentials;
docHandler.CreateDocumentLibrary(url, name);

Can anybody help me?


Do you know someone who can help? Share a link to this thread on twitter, or facebook.

Tagged:            

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Creating Document Library with C# / Webservice Or get search suggestion and latest updates.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].