Imaging.GetListItems Method

Returns the last modified date and other information about the items in a specified folder in a list on the current Web site.

Namespace:  [Imaging Web service]
Web service reference: http://Site/_vti_bin/Imaging.asmx

Syntax

'Declaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/ois/GetListItems", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/ois/",  _
    ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/ois/",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetListItems ( _
    strListName As String, _
    strFolder As String _
) As XmlNode
'Usage
Dim instance As Imaging
Dim strListName As String
Dim strFolder As String
Dim returnValue As XmlNode

returnValue = instance.GetListItems(strListName, _
    strFolder)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/ois/GetListItems", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/ois/", 
    ResponseNamespace = "https://schemas.microsoft.com/sharepoint/soap/ois/", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public XmlNode GetListItems(
    string strListName,
    string strFolder
)

Parameters

  • strListName
    Type: System.String

    The name of the list within the current Web site.

  • strFolder
    Type: System.String

    The relative path from the root of the list to the target folder.

Return Value

Type: System.Xml.XmlNode
A Microsoft.SharePoint.SoapServer.SoapXml object that contains the following.

<Library name="strListName " 
  xmlns="https://schemas.microsoft.com/sharepoint/soap/ois/">
  <z:row xmlns:z="#RowsetSchema" ows_ID="1" 
    ows_Created="2002-05-02 19:41:36" 
    ows_Author="1;#User_Alias" ows_Modified="2002-05-02 19:41:36" 
    ows_Editor="1;#User_Alias" ows__ModerationStatus="0" 
    ows_FileRef="1;#t1/55VGXIE6.jpg" 
    ows_Last_x0020_Modified="1;#2002-05-02 19:41:36" 
    ows_Created_x0020_Date="1;#2002-05-02 19:41:36" 
    ows_File_x0020_Size="1;#30917" ows_FSObjType="1;#0" 
    ows_CheckoutExpires="1;#" ows_CheckedOutUserId="1;#" 
    ows_FileLeafRef="1;#55VGXIE6.jpg" ows_VirusStatus="1;#30917" 
    ows_CheckedOutTitle="1;#" 
    ows_Modified_x0020_By="Domain\User_Name" 
    ows_owshiddenversion="0" ows_File_x0020_Type="jpg" 
    ows_LinkFilenameNoMenu="55VGXIE6.jpg" 
    ows_LinkFilename="55VGXIE6.jpg" 
    ows_DocIcon="jpg" ows_ServerUrl="/t1/55VGXIE6.jpg" 
    ows_EncodedAbsUrl="http://Server_Name/t1/55VGXIE6.jpg" 
    ows_BaseName="55VGXIE6" ows_FileSizeDisplay="30917" 
    ows_LinkSharing="<a href=
      "http://Server_Name/_layouts/1033/ShrOpt.aspx?
      obj=,document,{5DE3F393-52CF-4644-BA74-FF868C120A05}">
      ["Has Unique Perms" column value]</a>" 
    ows_ImageWidth="736" ows_ImageHeight="467" 
    ows_ThumbnailUrl="http:/ Server_Name/t1/_t/55VGXIE6_jpg.jpg" 
    ows_WebImgUrl="http://Server_Name/t1/_w/55VGXIE6_jpg.jpg" 
    ows_NameOrTitle="jpg" ows_SelectedFlag="0" ows_ImageSize="736" 
    ows_RequiredField="t1/55VGXIE6.jpg" />
    .
    .
    .
</Library>

Exceptions

Exception Condition
[0x1]

ListNotFound: The requested list is not found.

[0x2]

IsNotLibrary: The requested list, although found, is not a picture library.

[0x3]

ItemNotFound: The requested list item is not found.

[0x4]

FolderNotFound: The requested folder is not found.

[0x5]

InvalidArgument: One or more arguments are not valid.

[0x6]

FileExists: The file already exists, and the user does not specify the overwrite option.

Remarks

Because the actual XML for each item is a direct copy of the Microsoft Windows SharePoint Services object model output, and Windows SharePoint Services can change its format from time to time, the XML is volatile.

Examples

The following code example shows how to create a new folder in the folder "1".

Note

This code assumes that the site and the picture library already exist, that you have permissions on the server, and that the picture library contains some items.

Dim imgws As New Web_Reference.Imaging()
Dim resdoc As New System.Xml.XmlDocument()
Dim resnode As System.Xml.XmlNode = 
    resdoc.CreateNode(System.Xml.XmlNodeType.Element, "Result", "")
imgws.Credentials = System.Net.CredentialCache.DefaultCredentials
imgws.Url = "http://MyServer/sites/mynewsite/_vti_bin/imaging.asmx"
resnode = imgws.GetListItems("My Pictures", "1")
MessageBox.Show(resnode.InnerXml)
Web_Reference.Imaging imgws = new Web_Reference.Imaging();
System.Xml.XmlDocument resdoc= new System.Xml.XmlDocument();
System.Xml.XmlNode resnode = 
    resdoc.CreateNode(System.Xml.XmlNodeType.Element,"Result","");
imgws.Credentials = System.Net.CredentialCache.DefaultCredentials;
imgws.Url = "http://MyServer/sites/mynewsite/_vti_bin/imaging.asmx";
resnode = imgws.GetListItems("My Pictures","1");
MessageBox.Show(resnode.InnerXml);

This code example shows how to create the site and picture library required in the preceding example and add a picture.

Note

You must be a member of the Administrators site group on the server running Microsoft Windows SharePoint Services to be able to add a reference to the Admin Web service and to perform the required actions.

Dim adminws As New Web_Reference.Admin()
adminws.Credentials = System.Net.CredentialCache.DefaultCredentials
Try
    adminws.CreateSite("http://MyServer/sites/my2003site", 
        "My 2003 New Site", _
        "Manage content and pictures for year 2003", 1033, "MPS#0", 
        "User_Alias", "Display_Name", "someone@example.com", "", "")
    Catch ex As Exception
        MessageBox.Show(ex.Message)
End Try

Dim listsws As New Web_Reference.Lists()
listsws.Credentials = System.Net.CredentialCache.DefaultCredentials
listsws.Url = "http://MyServer/sites/mynewsite/_vti_bin/lists.asmx"
Try
    listsws.AddList("My Pictures", "My personal pictures", 109)
    Catch ex1 As Exception
        MessageBox.Show(ex1.Message)
End Try

Dim imgws As New Web_Reference.Imaging()
Dim resdoc As New System.Xml.XmlDocument()
Dim resnode As System.Xml.XmlNode = 
    resdoc.CreateNode(System.Xml.XmlNodeType.Element, "Result", "")
imgws.Credentials = System.Net.CredentialCache.DefaultCredentials
imgws.Url = "http://MyServer/sites/mynewsite/_vti_bin/imaging.asmx"
Dim b As [Byte]() = System.Text.Encoding.Unicode.GetBytes
    ("R0lGODlhCQALAJEAAAoLBv///wAAAP///
    yH5BAEAAAMALAAAAAAJAAsAAAIdlIdmETDAxBAxosm
    CvE9fNU0K40Ae1ZBftq0t9xYAOw==")
imgws.Upload("My Pictures", "1", b, "Red Figure2.gif", True)
MessageBox.Show("Picture uploaded")
resnode = imgws.GetListItems("My Pictures", "1")
MessageBox.Show(resnode.InnerXml)
Web_Reference.Admin adminws = new Web_Reference.Admin();
adminws.Credentials= System.Net.CredentialCache.DefaultCredentials;
try
{
   adminws.CreateSite("http://MyServer/sites/my2003site",
    "My 2003 New Site",
   "Manage content and pictures for year 
      2003",1033,"MPS#0","User_Alias",
   "Display_Name","someone@example.com","","");
}
catch(Exception ex)
{
   MessageBox.Show(ex.Message);
}
Web_Reference.Lists listsws = new Web_Reference.Lists();
listsws.Credentials = System.Net.CredentialCache.DefaultCredentials;
listsws.Url = "http://MyServer/sites/mynewsite/_vti_bin/lists.asmx";
try
{
   listsws.AddList("My Pictures","My personal pictures",109);
}
catch(Exception ex1)
{
   MessageBox.Show(ex1.Message);
}
Web_Reference.Imaging imgws = new Web_Reference.Imaging();
System.Xml.XmlDocument resdoc= new System.Xml.XmlDocument();
System.Xml.XmlNode resnode = 
   resdoc.CreateNode(System.Xml.XmlNodeType.Element,"Result","");
imgws.Credentials = System.Net.CredentialCache.DefaultCredentials;
imgws.Url = "http://MyServer/sites/mynewsite/_vti_bin/imaging.asmx";
Byte[] b =System.Text.Encoding.Unicode.GetBytes
   ("R0lGODlhCQALAJEAAAoLBv///wAAAP///
   yH5BAEAAAMALAAAAAAJAAsAAAIdlIdmETDAxBAxosm
   CvE9fNU0K40Ae1ZBftq0t9xYAOw==");
imgws.Upload("My Pictures","1",b,"Red Figure2.gif", true);
MessageBox.Show("Picture uploaded");
resnode = imgws.GetListItems("My Pictures","1");
MessageBox.Show(resnode.InnerXml);

See Also

Reference

Imaging Class

Imaging Members

Imaging Web Service