Today I am trying to populate an ASP.Net drop down list from the contents of a SharePoint list using the Lists web service.
I found this Microsoft page that was most useful in helping me to do that: http://msdn.microsoft.com/en-us/library/lists.lists.getlistitems.aspx
A couple of issues I struck that are mentioned in the article:
- I was getting a SOAP error saying “Guid should contain 32 digits with 4 dashes”. As mentioned in the above article this is due to Visual Studio putting a web reference in Web.config to the top level site rather than the sub-site in which the list exists.
- Once the above was fixed, I got a second error: “InvalidOperationException: Client found response content type of ‘text/html; charset=utf-8’, but expected ‘text/xml’”.