listados.Credentials = new NetworkCredential("xxx", "xxx", "xxx");
ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(AcceptAllCertifications);
XmlDocument xmlDoc = new System.Xml.XmlDocument();
XmlNode ndQuery = xmlDoc.CreateNode(XmlNodeType.Element, "Query", "");
XmlNode ndViewFields = xmlDoc.CreateNode(XmlNodeType.Element, "ViewFields", "");
XmlNode ndQueryOptions = xmlDoc.CreateNode(XmlNodeType.Element, "QueryOptions", "");
ndViewFields.InnerXml = "
if (subruta.Equals(string.Empty))
ndQueryOptions.InnerXml = "
else
ndQueryOptions.InnerXml = "
listados.Url = urlSharepoint + "/" + nombreSite + "/_vti_bin/Lists.asmx";
xml = listados.GetListItems(nombreLista, nombreVista, null, ndViewFields, "0", ndQueryOptions, "");
System.IO.StringReader sr = new System.IO.StringReader(xml.InnerXml);
XmlTextReader tr = new XmlTextReader(sr);
DataSet ds = new DataSet("resultDataSet");
ds.ReadXml(tr);
if (ds != null && ds.Tables.Count >= 2 && ds.Tables[1].Rows.Count >= 1)
{
//Si no existe la columna de LinkFileName la creo a partir de la columna de FileRef
if (!ds.Tables[1].Columns.Contains("ows_LinkFilename"))
{
ds.Tables[1].Columns.Add(new DataColumn("ows_LinkFilename"));
foreach (DataRow row in ds.Tables[1].Rows)
{
No hay comentarios:
Publicar un comentario