views:

177

answers:

2

Hi,

i would like to create a folder in Shareopoint 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: (No Error) the Second time, i get the message: AlreadyExists

But i do not see the folder on my website!?

What am I doing wrong? Thanks in advance,

Jene

A: 

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.

Rubens Farias
But if i put Path in above format (as suggested by you) it is showing " <Error ID=“10”>FolderNotFound</Error>"
Jene
I didn't suggested that: I just suggest to check into full path: replace server_name, user_name, workspace_name for actual values and you'll probably find your new folder. I think you're checking on wrong place
Rubens Farias
i specified the desired path.As: "sitename/Documents/newfoldername"Folders are getting created but not on specified path but on "Style Library".But why so?
Jene
A: 

1) Edit your web refrence config to include the proper path to you application.

You config will look like this http://someserver/_vti_bin/Dws.asmx change it to xhttp://someserver/sub1/sub2/_vti_bin/Dws.asmx

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

Cody