3
votes

Alright, so I've figured out how to connect to a web service (.NET 2.0 style) and return some lists.

private void PrintLists()
{
    // ListsService is a property that returns the Lists web service, authenticated.
    XmlNode node = ListsService.GetListCollection();
    foreach (XmlNode sub_node in node.ChildNodes)
    {
        Console.WriteLine(sub_node.Attributes["Title"].InnerText);
    }
}

This returns a number of lists that indeed exist in the SharePoint instance.

The problem I have is that the list I want is deep within SharePoint. There are "sub-sites" or "sub-webs", as I understand they're called (please correct me if I'm wrong), which are the tabs at the top of the SharePoint page when viewed in a browser. In one of those tabs, there is a particular sub-section and then finally there is a number of lists, one of which I wish to retrieve.

But those lists don't show up when I fetch them with the above code, understandably because I haven't told the web service where to look for them, and that's where I'm stuck. I don't know how to specify the location of the list that I want to retrieve.

Any help greatly appreciated as always.

1
Site (Developer) = Site Collection = SPSiteCollection (API), Site (End User) = Web = SPWeb (API). Confusing and lame. See the "Community Content" at the bottom of msdn.microsoft.com/en-us/library/… -- Happy coding (also, check out sharepointoverflow)user166390

1 Answers

6
votes

http://msdn.microsoft.com/en-us/library/lists%28office.12%29.aspx

Do this before the call:

ListsService.Url = "http://yourserver/sites/yoursite/_vti_bin/lists.asmx"