views:

882

answers:

2

Arrggh. I've seen like 15 examples that say do it like this: http://stackoverflow.com/questions/583606/sharepoint-web-services-test-if-file-exists

I'm on the same machine as the SP site, running as the SP and machine admin, I can happily call GetList, GetListCollection and GetWeb on the SiteData web service, but every time I call GetListItems on the Lists web service I get a "Value cannot be null.\nParameter name: g" error.

Nothing in the event viewer. Nothing in the sharepoint log files that relates Does anyone know a cause/fix/ where to look?

System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
    System.Xml.XmlNode ndQuery = xmlDoc.CreateNode(System.Xml.XmlNodeType.Element, "Query", "");
    System.Xml.XmlNode ndViewFields = xmlDoc.CreateNode(System.Xml.XmlNodeType.Element, "ViewFields", "");
    System.Xml.XmlNode ndQueryOptions = xmlDoc.CreateNode(System.Xml.XmlNodeType.Element, "QueryOptions", "");

    ndQuery.InnerXml = "<OrderBy><FieldRef Name=\"ID\" /></OrderBy>";


    ndQueryOptions.InnerXml = "<IncludeMandatoryColumns>TRUE</IncludeMandatoryColumns><IncludeAttachmentUrls>FALSE</IncludeAttachmentUrls><Paging />";

    svc.GetListItems(list.ListName, null, ndQuery, ndViewFields, "5", ndQueryOptions, list.WebID.ToString());
A: 

I've tried your exact same code and it's worked perfectly for me. Also from your comment about GetListCollection() there is something environmental going wrong.

Have you checked over how you are connecting to the service? Perhaps tried it in its own console application?

If you can post the code relating to the service connection that might help further. Also is there anything unusual about how the web application has been set up (e.g. alternate access mappings).

Alex Angas
That's what I was starting to figure. I've seen otehr posts on the web about "missing WEBID attributes on the column definitions" and similar, but none of it matches when I investigate, or the results I get are completely contrary to what they say to look for (like the GetListColumns). Given this was a vanilla install, I'm really get frustrated.
Roger Willcocks
Without seeing your environment it's hard to know where to look. You could try using a tool like WinMerge to compare a working c:\inetpub\wss\... and 12 Hive with your install. See if there are any differences that stand out as causing the problem. Also throughly compare the IIS configuration.
Alex Angas
A: 

You need to pass string.empty as the second paramter (view name) rather than a null value.

SharePointDave