Lists.GetListAndView method

Returns the list and view schemas for the specified list.

Namespace:  WebSvcLists
Assembly:  STSSOAP (in STSSOAP.dll)

<SoapDocumentMethodAttribute("", RequestNamespace := "",  _
	ResponseNamespace := "",  _
	Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetListAndView ( _
	listName As String, _
	viewName As String _
) As XmlNode
Dim instance As Lists
Dim listName As String
Dim viewName As String
Dim returnValue As XmlNode

returnValue = instance.GetListAndView(listName, _


Type: System.String

A string that contains either the title or GUID for the list. When querying the UserInfo table, the string contains "UserInfo".

Type: System.String

A string that contains the GUID for the view. If no value is specified, returns the default view schema for the list.

Return value

Type: System.Xml.XmlNode
A fragment in Collaborative Application Markup Language (CAML) in the following form that contains the list and view schemas, and that can be assigned to a System.Xml.XmlNode object.
<ListAndView xmlns="">
   <List DocTemplateUrl=
         "" DefaultViewUrl="/Site_Name/Lists/List_Name/AllItems.aspx" 
      ID="{42FC00F1-F7EA-4ECE-9D4C-F47A95A806B2}" Title="List_Name" 
      Description="TestCustList" ImageUrl="/_layouts/images/itgen.gif" 
      Name="{42FC00F1-F7EA-4ECE-9D4C-F47A95A806B2}" BaseType="0" 
      Created="20030616 18:37:44" Modified="20030618 18:26:57" 
         LastDeleted="20030616 18:37:44" 
      Version="2" Direction="none" ThumbnailSize="" WebImageWidth="" 
      Flags="4096" ItemCount="5" AnonymousPermMask="" 
      ReadSecurity="1" WriteSecurity="1" Author="1" 
         EventSinkAssembly="" EventSinkClass="" 
      EventSinkData="" EmailInsertsFolder="" AllowDeletion="True" 
      EnableAttachments="True" EnableModeration="False" 
         EnableVersioning="False" Hidden="False" 
      MultipleDataList="False" Ordered="False" ShowUser="True">
         <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" />
   <View Name="{8C25D6A5-93B4-4611-B449-55A7C3B7B41A}" Type="HTML" 
      DisplayName="View_Name" Url="Lists/List_Name/View_File.aspx" 
      <Query />
         <FieldRef Name="Attachments" />
         <FieldRef Name="LinkTitle" />
         <FieldRef Name="DateColumn" />
      <RowLimit Paged="TRUE">100</RowLimit>

The following code example displays the list and view schemas for a specified list on the current site.

This example requires that a using (Visual C#) or Imports (Visual Basic) directive be included for the System.Xml namespace.

Dim listService As New Web_Reference_Folder.Lists()
listService.Credentials = System.Net.CredentialCache.DefaultCredentials

Dim ndLists As XmlNode = listService.GetListAndView("List_Name",