SiteData.GetList Method
Returns metadata from the specified SharePoint list.
Namespace: [SiteData Web service]
Web service reference: http://Site/_vti_bin/SiteData.asmx
Syntax
'Declaration
<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 ( _
strListName As String, _
<OutAttribute> ByRef sListMetadata As _sListMetadata, _
<OutAttribute> ByRef vProperties As _sProperty() _
) As UInteger
'Usage
Dim instance As SiteData
Dim strListName As String
Dim sListMetadata As _sListMetadata
Dim vProperties As _sProperty()
Dim returnValue As UInteger
returnValue = instance.GetList(strListName, _
sListMetadata, vProperties)
[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 uint GetList(
string strListName,
out _sListMetadata sListMetadata,
out _sProperty[] vProperties
)
Parameters
strListName
Type: System.StringA string that contains either the name of the list or the GUID of the list enclosed in curly braces ({}).
sListMetadata
Type: [SiteData Web service]._sListMetadataReturns metadata from the list.
vProperties
Type: []Returns an array that contains information about each field in the list, including its name, title, and type.
Return Value
Type: System.UInt32
A 32-bit unsigned integer that returns 0 to indicate that the operation has completed.
Remarks
Returns general information, schema of the fields and access right permissions for a given List.
Examples
The following code example displays information about a specified list, including its title and default view URL, but also the title, name, and type of each field in the list. This example assumes the existence of a label within the form of a Windows Application.
Dim srvSiteData As New Web_Reference_Name.SiteData()
srvSiteData.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim lstMetaData As Web_Reference_Name._sListMetadata
Dim lstFields() As Web_Reference_Name._sProperty
srvSiteData.GetList("List_Title", lstMetaData, lstFields)
label1.Text = lstMetaData.Title + " :: " + lstMetaData.DefaultViewUrl + ControlChars.Lf
Dim field As Web_Reference_Name._sProperty
For Each field In lstFields
label1.Text += field.Title + " :: " + field.Name + " :: " + field.Type + ControlChars.Lf
Next field
Web_Reference_Name.SiteData srvSiteData = new Web_Reference_Name.SiteData();
srvSiteData.Credentials = System.Net.CredentialCache.DefaultCredentials;
Web_Reference_Name._sListMetadata lstMetaData;
Web_Reference_Name._sProperty[] lstFields;
srvSiteData.GetList("List_Title", out lstMetaData, out lstFields);
label1.Text = lstMetaData.Title + " :: " + lstMetaData.DefaultViewUrl + "\n";
foreach (Web_Reference_Name._sProperty field in lstFields)
{
label1.Text += field.Title + " :: " + field.Name + " :: " + field.Type + "\n";
}