2009-08-20 5 views
4

"User Information List"の内容を取得しようとしています。このリストは管理ユーザーとしてのみアクセスできます。SharepointがWebサービス経由で "User Information List"にアクセスしています

var xmlDoc = new XmlDocument(); 
var query = xmlDoc.CreateElement("Query"); 
query.InnerXml = "<Where><Eq><FieldRef Name='ContentType' /><Value Type='Choice'>Person</Value></Eq></Where>"; 
XmlElement viewFields = xmlDoc.CreateElement("ViewFields"); 
viewFields.InnerXml = "<FieldRef Name='Title' />"; 
XmlElement queryOptions = xmlDoc.CreateElement("QueryOptions"); 
var items = ws.GetListItems("User Information List", "", query, viewFields, string.Empty, queryOptions, "8A391AE3-2783-489B-8BDF-D2AE971D73CD"); 

マイリスト名が正しいので、私はSharePointのエクスプローラ

<List DocTemplateUrl="" DefaultViewUrl="/_catalogs/users/detail.aspx" MobileDefaultViewUrl="" ID="{8A391AE3-2783-489B-8BDF-D2AE971D73CD}" Title="User Information List" Description="All people." ImageUrl="/_layouts/images/users.gif" Name="{8A391AE3-2783-489B-8BDF-D2AE971D73CD}" BaseType="0" FeatureId="" ServerTemplate="112" Created="20080430 02:48:38" Modified="20090819 08:31:52" LastDeleted="20090604 12:32:50" Version="141" Direction="none" ThumbnailSize="" WebImageWidth="" WebImageHeight="" Flags="41971988" ItemCount="46" AnonymousPermMask="0" RootFolder="/_catalogs/users" ReadSecurity="1" WriteSecurity="1" Author="1" EventSinkAssembly="" EventSinkClass="" EventSinkData="" EmailInsertsFolder="" EmailAlias="" WebFullUrl="/" WebId="767c0b20-058d-4b53-8362-81e005bf5098" SendToLocation="" ScopeId="64857900-37cf-431c-be07-5528d1ae46af" MajorVersionLimit="0" MajorWithMinorVersionsLimit="0" WorkFlowId="" HasUniqueScopes="False" AllowDeletion="False" AllowMultiResponses="False" EnableAttachments="True" EnableModeration="False" EnableVersioning="False" Hidden="True" MultipleDataList="False" Ordered="False" ShowUser="True" EnableMinorVersion="False" RequireCheckout="False" /> 

Iを経由して下からhtat得たGUIDです:私は、管理者ユーザとしてログインし、この方法は、以下を行い持っています次のエラーが返されています:

<?xml version="1.0" encoding="utf-8"?> 
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
     <soap:Body> 
      <soap:Fault> 
       <faultcode>soap:Server</faultcode> 
       <faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</faultstring> 
       <detail> 
        <errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">The system cannot find the file specified. (Exception from HRESULT: 0x80070002)</errorstring> 
       </detail> 
      </soap:Fault> 
     </soap:Body> 
    </soap:Envelope> 

なぜこのエラーが発生しているのですか?

更新

ライン

var items = ws.GetListItems("User Information List", "", query, viewFields, string. 

は、C#コードで例外をスローしています。スローされる例外は次のとおりです。

Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown. 

ない多くの援助...

アップデート2

私は、Web http://www.aidangarnish.net/blog/post/2008/04/Retrieving-items-from-a-MOSS-2007-list-using-web-services.aspx上でこれを見つけたとする私のコードを変更:

var node = ws.GetListItems("User Information List", String.Empty, null, null, String.Empty, null, null); 

結果が表示されます。私の最初のクエリで何が間違っているのかわからないので、質問は立っています...

+0

。 – trgraglia

答えて

1
var node = ws.GetListItems("User Information List", String.Empty, null, null, String.Empty, null, null); 

試行錯誤して正常に動作するようです。

1

私はあなたの質問に答えてくれるのか分かりませんが、私は管理者は、あなたが使用してユーザ情報テーブルにアクセスする場合:

  • "のUserInfo"

の代わりに:

  • "ユーザー情報一覧"
  • 0ここではマニュアルに記載されている

その: http://msdn.microsoft.com/en-us/library/lists.lists.getlist.aspx

LISTNAME リストについては、タイトルまたはGUIDのいずれかを含む文字列。 UserInfoテーブルをクエリするとき、文字列には "UserInfo"が含まれます。

おそらく、そのショットを与えます。

+0

これは私のリストlistService.GetList( "UserInfo")です。しかし、私はその中のアイテムが必要です... – Rupert

+0

確かに、上記のコードで同じテクニックを使って項目を取得してください。 –

+0

上記と同じエラー... – Rupert

3

"指定されたファイル(指定されたファイルが見つかりませんでした(例外:HRESULT:0x80070002の例外)"を再度見つけることができない場合は、最後のパラメータ "webId"をnullに設定してください。言って、マイクロソフトによるWebサービスの仕様で

ルック:

webID: Optional. A string containing the GUID of the parent Web site for the list surrounded by curly braces ({}). Setting this parameter to null means the Web site specified by the URL property of the service will be used, and if the URL property of the service is not specified, the root Web site will be used.

出典:あなたはあまりにもSPServicesを使用することができますhttp://msdn.microsoft.com/en-us/library/lists.lists.getlistitems(v=office.12).aspx

関連する問題