Preeti
Preeti

Reputation: 1386

Create Folder() Showing "<Result/>".But Folder are not getting created on Sharepoint

I would like to create a folder in Sharepoint 2007 with C# using DWS Web Service.

Code:

dwsFolder.CreateFolder(@"Test_FormLib/myNewFolder");

If I use the program for the first time, I get the message:

<Result/>

No error. The second time I get the message:

<Error ID="13">AlreadyExists</Error>

But I do not see the folder on my website.

What am I doing wrong?

Upvotes: 0

Views: 1952

Answers (3)

TheClownsatMicrosoft
TheClownsatMicrosoft

Reputation: 11

In another clown product from Microsoft, I just spend 4 hours on this exact problem. CreateFolder only works properly for document libraries, not form libraries. If you're trying to write to a form library, your documents are going to show up in another folder. For me, they were showing up in 'shared documents', even though I was specifying to create a folder under 'test'.

Upvotes: 1

Cody
Cody

Reputation: 1

  1. Edit your web refrence config to include the proper path to your application.
    Your config will look like this:
    http://someserver/_vti_bin/Dws.asmx
    Change it to
    http://someserver/sub1/sub2/_vti_bin/Dws.asmx

  2. dwsFolder.CreateFolder("Shared Documents/myNewFolder");

Upvotes: 0

Rubens Farias
Rubens Farias

Reputation: 57976

Take a look at documentation: Dws.CreateFolder Method (Document Workspace):

The following code example shows the use of the CreateFolder method to create a new subfolder in the default document library of the site. The absolute URL of the new folder is "http://server_name/sites/user_name/workspace_name/Shared Documents/folder_name".

So, you must check if you're using correct site address, under authenticated user_name.

Upvotes: 0

Related Questions