2010-09-06 63 views
0

我在從usergroup.asmx webservice獲取正確的用戶信息時遇到問題。我將用戶名發送到web服務,並將userinfo作爲響應。在響應中,我看到userid = 87和username = john smith。Sharepoint webservices通過CAML添加任務

我調用updatelistitems webservice來添加一個任務,而assignedTo字段的值是:userid; #username(ex。87; #john smith)。當我提交這個任務時,會創建一個任務,但分配的用戶不是約翰史密斯,而是其他人。

當我使用CAML查看器時,我發現john smith的id實際上是218,所以我嘗試添加一個assignTo = 218的任務; #john smith,它被賦值正確。

userinforesponse的id如何與實際的id不同?

我也嘗試發送assignedTo字段爲:域\用戶名,但後來我得到這個響應:「操作失敗,因爲發生了意外錯誤」。 所以我認爲assignedTo字段必須以這種形式,它的工作:ID; #username

THX的幫助

回答

1

用戶的ID是唯一的每個網站集。也許您用於UserGroup.asmx webservice的URL與Lists.asmx不同?他們應該是相同的:http://sharepoint/sites/SiteCollection/_vti_bin/Lists.asmxhttp://sharepoint/sites/SiteCollection/_vti_bin/UserGroup.asmx

+0

omg,你是對的,我把usergroup.asmx鏈接到了另一個SharePoint站點,愚蠢的我:p – 2010-09-08 09:31:41

+0

哈哈很樂意幫忙。 :) – 2010-09-08 17:52:33