开发者

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?


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'.


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.


  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");

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜