Imaging.ListPictureLibrary Method

Lists all picture libraries 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/ListPictureLibrary", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/ois/",  _
    ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/ois/",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function ListPictureLibrary As XmlNode
'Usage
Dim instance As Imaging
Dim returnValue As XmlNode

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

Return Value

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

<PictLib xmlns="https://schemas.microsoft.com/sharepoint/soap/ois/">
  <Library name="listName" title="listTitle" guid="listGUID" 
    url="rootFolder" />
  <Library . . . />
  .
  .
  .
</PictLib>

If the Web site has no picture libraries, this method returns the following without <Library> nodes:

<PictLib xmlns="https://schemas.microsoft.com/sharepoint/soap/ois/">
</PictLib>

Examples

The following code example shows how to list the picture libraries on a site.

Note

This code assumes that the site and at least one picture library already exist on the site and that you have permissions on the server.

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.ListPictureLibrary()
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.ListPictureLibrary();
MessageBox.Show(resnode.InnerXml);

The following example shows how to create the site and picture library required in the preceding example.

Note

You must be a member of the Administrators site group on the server that is running Microsoft Windows SharePoint Services to be able to add a reference to the Admin Web service and 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", 
            "DOMAIN\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"
resnode = imgws.ListPictureLibrary()
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",
      "DOMAIN\\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";
resnode = imgws.ListPictureLibrary();
MessageBox.Show(resnode.InnerXml);

See Also

Reference

Imaging Class

Imaging Members

Imaging Web Service