我有一个任务开发Windows应用程序将获取从SharePoint列表视图数据和工作过程中赢得窗体应用程序中的数据.
我以前用于获取数据使用Lists.asmx,views.asmx.
现在我才知道有其他的方式来获取从列表视图中的数据.
语法:
HTTPS://myserver.com / _vti_bin / owssvr.dll?CMD =显示&名单={列表ID}&查看={视图ID}&XMLDATA = TRUE
URL示例:
HTTPS://myserver.com / _vti_bin / owssvr.dll?CMD =显示&名单={EA1BD05B%2DDB5B%2D434B%2DB2FC%2DB9AB9EE18A91}&查看={B959F555%2D798B%2D4F47%2D9FBB%2D81513B85F906}&XMLDATA = TRUE
现在,它会给作为响应的XML数据.
写响应xmlDoc中和处理数据.
HttpWebRequest的myRequest = (HttpWebRequest的)WebRequest.Create(“HTTPS://myserver.com / _vti_bin / owssvr.dll?CMD =显示&名单={EA1BD05B%2DDB5B%2D434B%2DB2FC%2DB9AB9EE18A91}&查看={B959F555%2D798B%2D4F47%2D9FBB%2D81513B85F906}&XMLDATA = TRUE”);
myRequest.Credentials =
System.Net.CredentialCache.DefaultCredentials;
HttpWebResponse响应= (HttpWebResponse)myRequest.GetResponse();
XmlDocument的DOC =新的XmlDocument();
doc.Load(response.GetResponseStream());
给一个答复