Select All data from List Using Caml Query and sharepoint web services.this use for out of box application

Sagarp
Posted by Sagarp under Others category on | Points: 40 | Views : 6573
var arr = new Array();
var a = new ActiveXObject("Microsoft.XMLHTTP");
var id="dwt";
var listName="testlist";
var query="<Query><Where><Gt><FieldRef Name='ID' /><Value Type='Counter'>0</Value></Gt></Where></Query>";
if (a == null) return null;

var getListRequest = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
+ "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
+ "<soap:Body>"
+ "<GetListItems xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\">"
+ "<listName>" + listName + "</listName>"
+ "<query>" + query + "</query>"
+ "</GetListItems>"
+ "</soap:Body>"
+ "</soap:Envelope>";

a.Open("Post", http://servername:100/sites/Test/_vti_bin/Lists.asmx?op=GetListItems", false);

a.setRequestHeader("Content-Type:", "text/xml; charset=utf-8");
a.setRequestHeader("SOAPAction:", "http://schemas.microsoft.com/sharepoint/soap/GetListItems");
a.Send(getListRequest);
var xmlDoc = a.responseXML;

Comments or Responses

Login to post response