Currently I have an ASP.net 4.0 app in which I've made a web reference to an MOSS 2007 server. When I access any lists.asmx methods from the root application, everything works fine. However, if I try to change the service URL in C# code-behind to that of a subfolders list.asmx, then access the any method, I get a 404 error. The really strange thing though is if I take the URL that I've changed it to and plug it manually into IE and run it, the service loads fine (giving me a list of any methods available as expected.)
Here's a rundown of my code that I'm using:
This works:
ListsService.Lists m_listService =
ICredentials m_credentials = CredentialCache.DefaultCredentials;
m_listService.Credentials = m_credentials;
// No change to URL, defaults to 'http://mosstest/SiteDirectory/RootApp/SubApp/_vti_bin/lists.asmx'
XmlNode listColl = m_listService.GetListCollection(); // Works fine, gives me collection of lists in the root folder.
This doesn't work:
ListsService.Lists m_listService =
ICredentials m_credentials = CredentialCache.DefaultCredentials;
m_listService.Credentials = m_credentials;
m_listService.Url = "http://mosstest/SiteDirectory/RootApp/SubApp/Subfolder1/_vti_bin/lists.asmx";
XmlNode listColl = m_listService.GetListCollection(); // Throws a 404 Not found error.
Anyone else run into something similar?