I'm trying to use the GetListItems web service in MOSS 2007 to return all the columns and rows in custom SharePoint list. I don't need to filter any of the data, so I've left the QueryOptions and Query nodes empty.
I have copied and pasted the CAML below. As you can see from the query result, the xmlnode is not returning the custom meta data columns I've defined on the list. Here's the CAML Query:
Dim xmlDoc As XmlDocument = New System.Xml.XmlDocument()
Dim ndQuery As XmlNode = xmlDoc.CreateNode(XmlNodeType.Element, "Query", "")
Dim ndViewFields As XmlNode = xmlDoc.CreateNode(XmlNodeType.Element, "ViewFields", "")
Dim ndQueryOptions As XmlNode = xmlDoc.CreateNode(XmlNodeType.Element, "QueryOptions", "")
ndQuery.InnerXml = "<Query />"
ndQueryOptions.InnerXml = "<QueryOptions />"
ndViewFields.InnerXml = "<ViewFields>" + _
"<FieldRef Name='Title' />" + _
"<FieldRef Name='Account_x0020_Number' />" + _
"<FieldRef Name='Address_x0020_1' />" + _
"<FieldRef Name='Address_x0020_2' />" + _
"<FieldRef Name='Address_x0020_3' />" + _
"<FieldRef Name='Country' />" + _
"<FieldRef Name='Bank_x0020_Name' />" + _
"<FieldRef Name='Bank_x0020_Address' />" + _
"<FieldRef Name='Bank_x0020_Swift_x0020_Code' />" + _
"<FieldRef Name='Intermediary_x0020_Bank' />" + _
"<FieldRef Name='Intermediary_x0020_Bank_x0020_Ac' />" + _
"<FieldRef Name='Intermediary_x0020_Bank_x0020_Sw' />" + _
"<FieldRef Name='Intermediary_x0020_Bank_x0020_AB' />" + _
"<FieldRef Name='Corp' />" + _
"</ViewFields>"
Dim strListId As String = "{AF558681-E8A7-453A-ABE7-D2EA3AF46F25}"
Dim strViewId As String = "{989C4CE4-3361-4BAC-BA81-911B65857559}"
Dim ndListItems As XmlNode = lists_ws.GetListItems(strListId, strViewId, ndQuery, ndViewFields, String.Empty, ndQueryOptions, String.Empty)
This is the query result (outer XML fragment):
<listitems xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<rs:data ItemCount="3">
<z:row ows_MetaInfo="1;#" ows__ModerationStatus="0" ows__Level="1" ows_Title="Cardanias" ows_ID="1" ows_owshiddenversion="2" ows_UniqueId="1;#{4131F39F-062E-48AA-A886-83102053B112}" ows_FSObjType="1;#0" ows_Created="2011-05-20 10:00:35" ows_FileRef="1;#Finance/Xfer/Lists/Payees/1_.000" />
<z:row ows_MetaInfo="2;#" ows__ModerationStatus="0" ows__Level="1" ows_Title="Blue Ocean A/S" ows_ID="2" ows_owshiddenversion="1" ows_UniqueId="2;#{94DCB1C4-1C42-478D-839E-1CA3E82BDA53}" ows_FSObjType="2;#0" ows_Created="2011-05-20 10:00:42" ows_FileRef="2;#Finance/Xfer/Lists/Payees/2_.000" />
<z:row ows_MetaInfo="3;#" ows__ModerationStatus="0" ows__Level="1" ows_Title="Asia Ltd." ows_ID="3" ows_owshiddenversion="1" ows_UniqueId="3;#{39D53595-3D2B-45AA-8E40-3766498C4050}" ows_FSObjType="3;#0" ows_Created="2011-05-20 10:00:51" ows_FileRef="3;#Finance/Xfer/Lists/Payees/3_.000" />
</rs:data>
</listitems>
I'm not getting back the columns I've requested in the "ViewFields" node. I've tried setting the QueryOptions to "IncludeMandatoryColumns = FALSE and TRUE, but neither has seemed to affect the OuterXML coming back.
I would expect to see the custom meta data column values that I specified in the tags?
Is there something I'm missing here?
Thanks in advance...