SharePoint : How to retrieve all the properties from a list by using the GetListItems() method.

The example given in the SDK doesnt retrieve all the properties of the list. For e.g., I want to retrieve the file size. This property not found the results returned by the SDK sample. The work around is as follows.

localhost.Lists listService = new localhost.Lists();

listService.Credentials = System.Net.CredentialCache.DefaultCredentials;

XmlDocument xmlDoc = new System.Xml.XmlDocument();

 

//empty view fields

XmlNode ndViewFields = xmlDoc.CreateNode(XmlNodeType.Element,"ViewFields","");

 

//get the items

XmlNode ndListItems = listService.GetListItems("Shared Documents", null, null, ndViewFields, null, null);

//display the node

MessageBox.Show(ndListItems.OuterXml);

 

//The file size property name will be ows_FileSizeDisplay