Hi All,
I have a requirement , customer want to view the data from any sharepoint sites in different farms in his own sharepoint site.
How could I achieve that, I have been suggested to user sharePoint Lists services.
SharePoint list services is giving me result when I run following code in console application.
ListsAsmxRef.Lists lsts = new ListsAsmxRef.Lists();
lsts.Credentials = System.Net.CredentialCache.DefaultCredentials;
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
System.Xml.XmlElement viewFields = xmlDoc.CreateElement("ViewFields");
viewFields.InnerXml = "<FieldRef Name=\"Title\" />" +
"<FieldRef Name=\"Name\" />";
XmlNode listItems = lsts.GetListItems("Documents", null, null, viewFields, null, null, null);
foreach (XmlNode node in listItems)
if (node.Name == "rs:data")
for (int f = 0; f < node.ChildNodes.Count; f++)
{
if (node.ChildNodes[f].Name == "z:row")
{
string title = node.ChildNodes[f].Attributes["ows_Title"].Value;
lblMyData.Text += title + " <br/>";
}
}
But when the same code is written in webpart then it gives me 401 Unauthorized error.
I had posted this issue earlier. I am told that that I am getting unauthorized error due to double hop issue.
Hence I have made created webapplication to claims based on kerberos.
My site is kerberos with claims authentication,
I have got the SPN created for site http://spalldev20-img:6318/ which is hosting the webpart.
I have got the delegation enabled on the application pool account being used by above webapplication.
The another site from whose list service I am trying to consume is also in the same domain but classic mode authentication.
Is it really possible to use webservices to get data from another sharePoint webapplication webservice.
Please help me with this issue.