TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Select All Data from List Using Caml Query and SharePoint Web Services
Sagar Pardeshi
Mar 31
2016
Code
2.1
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
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></fieldref></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;
SharePoint
Web Services
Caml Query