Imaging.GetListItems - Méthode

Retourne que la dernière modification de date et autres informations sur les éléments dans un dossier spécifié dans une liste 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/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
'Utilisation
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
)

Paramètres

  • strListName
    Type : System.String

    Le nom de la liste dans un site Web en cours.

  • strFolder
    Type : System.String

    Le chemin d'accès relatif à la racine de la liste vers le dossier cible.

Valeur renvoyée

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

<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: la liste demandée n'est pas trouvée.

[0x2]

IsNotLibrary: la liste demandée, bien trouvé, n'est pas une bibliothèque d'images.

[0x3]

ItemNotFound: l'élément demandé est introuvable.

[0x4]

FolderNotFound: le dossier demandé est introuvable.

[0x5]

InvalidArgument: un ou plusieurs arguments ne sont pas valide.

[0x6]

FileExists: le fichier existe déjà, et l'utilisateur ne spécifie pas l'option de remplacement.

Remarques

Étant donné que le code XML pour chaque article est une copie directe de la sortie de modèle objet Microsoft Windows SharePoint Services et Windows SharePoint Services peut modifier son format de temps à autre, le XML est volatil.

Exemples

L'exemple de code suivant montre comment créer un nouveau dossier dans le dossier « 1 ».

Notes

Ce code suppose que le site et la bibliothèque d'images existe déjà, que vous disposez des autorisations sur le serveur, et que la bibliothèque d'images contienne certains éléments.

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

Cet exemple de code montre comment créer la bibliothèque de site et d'image requise dans l'exemple précédent et ajouter une image.

Notes

Vous devez être membre du groupe de sites Administrateurs sur le serveur exécutant Microsoft Windows SharePoint Services pour ajouter une référence pour le service Web Admin et d'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", 
        "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);

Voir aussi

Référence

Imaging classe

Imaging - Membres

WebSvcImaging - Espace de noms