Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Creating Document Library with C# / Webservice

  Asked By: Taylor    Date: Aug 11    Category: Sharepoint    Views: 2638

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?

Share: 

 

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.

Related Topics:



Tagged:          

 

Related Post