Note that there are some explanatory texts on larger screens.

plurals
  1. POSharepoint accessing "User Information List" via a webservice
    primarykey
    data
    text
    <p>I am trying to get the contents of "User Information List". This list can only be acessed as an admin user. I have a method that logs in as the admin user and then does the following:</p> <pre><code>var xmlDoc = new XmlDocument(); var query = xmlDoc.CreateElement("Query"); query.InnerXml = "&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name='ContentType' /&gt;&lt;Value Type='Choice'&gt;Person&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;"; XmlElement viewFields = xmlDoc.CreateElement("ViewFields"); viewFields.InnerXml = "&lt;FieldRef Name='Title' /&gt;"; XmlElement queryOptions = xmlDoc.CreateElement("QueryOptions"); var items = ws.GetListItems("User Information List", "", query, viewFields, string.Empty, queryOptions, "8A391AE3-2783-489B-8BDF-D2AE971D73CD"); </code></pre> <p>My list Name is Correct and so is the GUID I got htat from below via SharePoint Explorer</p> <pre><code>&lt;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" /&gt; </code></pre> <p>I am being returned the following error:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;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"&gt; &lt;soap:Body&gt; &lt;soap:Fault&gt; &lt;faultcode&gt;soap:Server&lt;/faultcode&gt; &lt;faultstring&gt;Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.&lt;/faultstring&gt; &lt;detail&gt; &lt;errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/"&gt;The system cannot find the file specified. (Exception from HRESULT: 0x80070002)&lt;/errorstring&gt; &lt;/detail&gt; &lt;/soap:Fault&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt; </code></pre> <p>Do you know why I am getting this error?</p> <p><strong>Update</strong></p> <p>The line </p> <pre><code>var items = ws.GetListItems("User Information List", "", query, viewFields, string. </code></pre> <p>Is throwing an exception in the C# code. The exception being thrown is:</p> <pre><code>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown. </code></pre> <p>Not a lot of help...</p> <p><strong>Update 2</strong></p> <p>I found this on the web <a href="http://www.aidangarnish.net/blog/post/2008/04/Retrieving-items-from-a-MOSS-2007-list-using-web-services.aspx" rel="nofollow noreferrer">http://www.aidangarnish.net/blog/post/2008/04/Retrieving-items-from-a-MOSS-2007-list-using-web-services.aspx</a> and changed my code to:</p> <pre><code>var node = ws.GetListItems("User Information List", String.Empty, null, null, String.Empty, null, null); </code></pre> <p>I am now getting results! Still not sure what is wrong with my initial query so the question stands...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload