Imaging.ListPictureLibrary - Méthode

Répertorie toutes les bibliothèques d'images sur le site Web en cours.

Espace de noms :  WebSvcImaging
Assembly :  STSSOAP (dans STSSOAP.dll)

Syntaxe

'Déclaration
<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
'Utilisation
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()

Valeur renvoyée

Type : System.Xml.XmlNode
Un objet Microsoft.SharePoint.SoapServer.SoapXml qui contient les éléments suivants.

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

Si le site Web n'a pas les bibliothèques d'images, cette méthode retourne les éléments suivants sans <nœuds de> bibliothèque :

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

Exemples

L'exemple de code suivant montre comment répertorier les bibliothèques d'images sur un site.

Notes

Ce code suppose que le site et la bibliothèque au moins une image existent déjà sur le site et que vous disposez des autorisations sur le serveur.

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);

L'exemple suivant montre comment créer la bibliothèque de site et d'image requise dans l'exemple précédent.

Notes

Vous devez être membre du groupe de sites Administrateurs sur le serveur qui exécute Microsoft Windows SharePoint Services pour pouvoir ajouter une référence à l' Admin service Web et exécuter les actions requises.

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);

Voir aussi

Référence

Imaging classe

Imaging - Membres

WebSvcImaging - Espace de noms