c# - Sharepoint List Items Query -
How can I query the sharepoint list item using soap in C #? Code should be queried which will be placed on a host (SharePoint 2007, .NET 2.0). The list is located on the second host (SharePoint 2010) as far as I know, I can not use this purpose for the SPS ite, SPWeb ..
using it (sps ite site = new sps ite Can use "http: // hostname / ...")) (SPWeb web = site.OpenWeb ()) ... Can anyone tell me that How can this be done? Tnx!
You need to use SharePoint web services to integrate between two separate SharePoint instances .
-
Create a web context for the following URLs in your project: http: //sharepointserver/_vti_bin/lists.asmx -
Create a connection to the web service:
var client = new SharePointWebServices.Lists {credentials = new network credentials ("user name", "password")}; Var xmlDoc = New XmlDocument (); Var Viewfield = xmlDoc.CreateElement ("Viewfield"); ViewFields.InnerXml = "& Field; FieldRef Name = \" ows_FIELD You Try To Retreat \ "/ & gt;"; Var listGuid = ConfigurationManager.AppSettings ["GUID_OF_LIST"]; XmlNode ListAutam = client.GetListItems (listGuide, blank, blank, viewcount, blank, null, empty);
-
-
-
-
Foreach (XMLNode node in the list) {if (node.Name == "rs: data") {for (int f = 0; f & lt; node ChildNodes.Count; f ++) {if (node. ChildNode [F] ] .name == "z: line") {var xmlAttributeCollection = node.ChildNodes [f]. Features; If (xmlAttributeCollection! = Null) {string listItem = xmlAttributeCollection ["ows_ows_FIELD you want to retrieve"]. Values; }}}}}
Comments
Post a Comment