I am using the SharePoint SOAP web services to try collecting list and taxonomy data from a site on SharePoint Online.
The following code works nicely when connected to a standalone SharePoint farm. However, when connecting to SharePoint Online, the call to GetList fails with a SOAPException:
"Server was unable to process request. ---> Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"
Code:
using (ListService.Lists service = new ListService.Lists())
{
service.Credentials = new System.Net.NetworkCredential("username", "password");
XmlNode list = service.GetList("Doclib");
}
using (TaxonomyService.Taxonomywebservice taxonomy = new TaxonomyService.Taxonomywebservice())
{
// Set credentials
taxonomy.Credentials = System.Net.CredentialCache.DefaultCredentials;
for (int termSetCounter = 0; termSetCounter < allTermSetIds.Count; termSetCounter++)
{
int lcid = System.Globalization.CultureInfo.CurrentUICulture.LCID;
string termStoreId = String.Format("<termSetIds><termStoreId>{0}</termStoreId></termSetIds>", allSharedServiceIds[termSetCounter]);
string termSetId = String.Format("<termSetIds><termSetId>{0}</termSetId></termSetIds>", allTermSetIds[termSetCounter]);
// Get one term set from term store using Web Service
string resultXML = taxonomy.GetTermSets(termStoreId, termSetId, lcid, oldtimestamp, clientVersion, out timeStamp);
}
}
This blog post seems to indicate that the reason authenticating fails, is that Web Services against Office 365/SharePoint Online are not yet officially supported. There appears to be a workaround involving some shady gathering and pass-through of cookies from Internet Explorer, but this is a huge hack and I can't seem to get it working with a real-life application.
Microsoft does seem to have a list of Web Services available in SharePoint Online here, but this list does not seem to include the SOAP services mentioned above. I do not see any services that support taxonomy data either. Also, not even SharePoint Designer supports editing Taxonomy columns from the client-side. This does seem like a huge oversight, though.
Is there another way than Web Services to get access to list and taxonomy information from SharePoint Online sites? If not, is there any information available from Microsoft regarding when this will be supported?