Lists.GetList - Méthode
Renvoie un schéma pour la liste spécifiée.
Espace de noms : WebSvcLists
Assembly : STSSOAP (dans STSSOAP.dll)
Syntaxe
'Déclaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/GetList", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/", _
ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetList ( _
listName As String _
) As XmlNode
'Utilisation
Dim instance As Lists
Dim listName As String
Dim returnValue As XmlNode
returnValue = instance.GetList(listName)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/GetList", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/",
ResponseNamespace = "https://schemas.microsoft.com/sharepoint/soap/",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public XmlNode GetList(
string listName
)
Paramètres
listName
Type : System.StringChaîne qui contient le titre ou le GUID de la liste. Lors de l'interrogation de la table UserInfo, la chaîne contient « UserInfo ».
Valeur renvoyée
Type : System.Xml.XmlNode
Un fragment de Langue CAML (Collaborative Application Markup Language) sous la forme suivante qui contient le schéma de liste et qui peut être affecté à un objet System.Xml.XmlNode .
<List DocTemplateUrl="" DefaultViewUrl="/Site_Name/Lists/List_Name/AllItems.aspx"
ID="{42FC00F1-F7EA-4ECE-9D4C-F47A95A806B2}" Title="List_Name" Description="Description"
ImageUrl="/_layouts/images/itgen.gif" Name="{42FC00F1-F7EA-4ECE-9D4C-F47A95A806B2}"
BaseType="0" ServerTemplate="100" Created="20030616 18:37:44" Modified="20030618 18:26:57"
LastDeleted="20030616 18:37:44" Version="2" Direction="none" ThumbnailSize="" WebImageWidth=""
WebImageHeight="" Flags="4096" ItemCount="5" AnonymousPermMask=""
RootFolder="/Site_Name/Lists/List_Name" ReadSecurity="1" WriteSecurity="1"
Author="1" EventSinkAssembly="" EventSinkClass="" EventSinkData="" EmailInsertsFolder=""
AllowDeletion="True" AllowMultiResponses="False" EnableAttachments="True" EnableModeration="False"
EnableVersioning="False" Hidden="False" MultipleDataList="False" Ordered="False" ShowUser="True"
xmlns="https://schemas.microsoft.com/sharepoint/soap/">
<Fields>
<Field ColName="tp_ID" ReadOnly="TRUE" Type="Counter" Name="ID" PrimaryKey="TRUE"
DisplayName="ID" FromBaseType="TRUE" />
<Field Type="Text" Name="Title" DisplayName="Title" Required="TRUE" FromBaseType="TRUE"
ColName="nvarchar1" />
...
<Fields>
<RegionalSettings>
<Language>1033<Language>
<Locale>1025<Locale>
<CalendarType>6<CalendarType>
<AdvanceHijri>-1</AdvanceHijri>
<TimeZone>1</TimeZone>
<Time24>1</Time24>
<SortOrder>1033<SortOrder>
<Presence Enabled=”True” />
</RegionalSettings>
</List>
Exemples
L'exemple de code suivant affiche le schéma de liste spécifié.
Cet exemple suppose qu'une directive de Imports (Visual Basic) soit incluse pour l'espace de noms System.Xml ou de using (Visual c#).
Dim listService As New Web_Reference_Folder.Lists()
listService.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim ndLists As XmlNode = listService.GetList("List_Name")
MessageBox.Show(ndLists.OuterXml)
Web_Reference_Folder.Lists listService = new Web_Reference_Folder.Lists();
listService.Credentials= System.Net.CredentialCache.DefaultCredentials;
XmlNode ndLists = listService.GetList("List_Name");
MessageBox.Show(ndLists.OuterXml);