Skip to main content
Tweeted twitter.com/#!/StackSharePoint/status/326197608567668737
edited tags
Link
added 5 characters in body
Source Link
    function GetListItems() {
       
        var soapEnv = "<?xml version='1.0' encoding='utf-8'?><soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>" +
             "<soap:Body> " +
             "<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> " +
              "<listName>SomeList</listName> " +
               "<query><Query><Where><Gt><FieldRef Name='ID' /><Value Type='Counter'>1</Value></Gt></Where></Query></query> " +
              " <viewFields> <ViewFields> <FieldRef Name='SomeContent' /></ViewFields></viewFields> " +
              "<rowLimit>100</rowLimit>" +
             "<queryOptions xmlns:SOAPSDK9='http://schemas.microsoft.com/sharepoint/soap/' ><QueryOptions/> " +
            "</queryOptions> </GetListItems></soap:Body> </soap:Envelope>";
      

        jQuery.ajax({
            url: "http://sharepointsiteurl/_vti_bin/lists.asmx",
            
            type: "POST",
            dataType: "xml",
            data: soapEnv,
            error: ErrorFunc,
            complete:GetListItemsComplete,
            contentType: "text/xml; charset=\"utf-8\""
        });
    }
    function ErrorFunc(xData, status) {
        debugger;
        alert(xData.responseText);
    }
    function GetListItemsComplete(xData, status) {

        var a = xData.responseText;
        alert(a);
        $(xData.responseXML).find("z\\:row, row").each(function () {
            var title = $(this).attr("ows_SomeContent");
            $($(this).attr("ows_SomeContent")).appendTo("#Announcements");
        });

    }
   
</script>
<a href="#" onclick="Javascript:GetListItems();">Get List Items</a>
<div id="Announcements">
</div>
Any help will be appreciated...
    function GetListItems() {
       
        var soapEnv = "<?xml version='1.0' encoding='utf-8'?><soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>" +
             "<soap:Body> " +
             "<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> " +
              "<listName>SomeList</listName> " +
               "<query><Query><Where><Gt><FieldRef Name='ID' /><Value Type='Counter'>1</Value></Gt></Where></Query></query> " +
              " <viewFields> <ViewFields> <FieldRef Name='SomeContent' /></ViewFields></viewFields> " +
              "<rowLimit>100</rowLimit>" +
             "<queryOptions xmlns:SOAPSDK9='http://schemas.microsoft.com/sharepoint/soap/' ><QueryOptions/> " +
            "</queryOptions> </GetListItems></soap:Body> </soap:Envelope>";
      

        jQuery.ajax({
            url: "http://sharepointsiteurl/_vti_bin/lists.asmx",
            
            type: "POST",
            dataType: "xml",
            data: soapEnv,
            error: ErrorFunc,
            complete:GetListItemsComplete,
            contentType: "text/xml; charset=\"utf-8\""
        });
    }
    function ErrorFunc(xData, status) {
        debugger;
        alert(xData.responseText);
    }
    function GetListItemsComplete(xData, status) {

        var a = xData.responseText;
        alert(a);
        $(xData.responseXML).find("z\\:row").each(function () {
            var title = $(this).attr("ows_SomeContent");
            $($(this).attr("ows_SomeContent")).appendTo("#Announcements");
        });

    }
   
</script>
<a href="#" onclick="Javascript:GetListItems();">Get List Items</a>
<div id="Announcements">
</div>
Any help will be appreciated...
    function GetListItems() {
       
        var soapEnv = "<?xml version='1.0' encoding='utf-8'?><soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>" +
             "<soap:Body> " +
             "<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> " +
              "<listName>SomeList</listName> " +
               "<query><Query><Where><Gt><FieldRef Name='ID' /><Value Type='Counter'>1</Value></Gt></Where></Query></query> " +
              " <viewFields> <ViewFields> <FieldRef Name='SomeContent' /></ViewFields></viewFields> " +
              "<rowLimit>100</rowLimit>" +
             "<queryOptions xmlns:SOAPSDK9='http://schemas.microsoft.com/sharepoint/soap/' ><QueryOptions/> " +
            "</queryOptions> </GetListItems></soap:Body> </soap:Envelope>";
      

        jQuery.ajax({
            url: "http://sharepointsiteurl/_vti_bin/lists.asmx",
            
            type: "POST",
            dataType: "xml",
            data: soapEnv,
            error: ErrorFunc,
            complete:GetListItemsComplete,
            contentType: "text/xml; charset=\"utf-8\""
        });
    }
    function ErrorFunc(xData, status) {
        debugger;
        alert(xData.responseText);
    }
    function GetListItemsComplete(xData, status) {

        var a = xData.responseText;
        alert(a);
        $(xData.responseXML).find("z\\:row, row").each(function () {
            var title = $(this).attr("ows_SomeContent");
            $($(this).attr("ows_SomeContent")).appendTo("#Announcements");
        });

    }
   
</script>
<a href="#" onclick="Javascript:GetListItems();">Get List Items</a>
<div id="Announcements">
</div>
Any help will be appreciated...
Source Link

SharePoint 2010 web service - GetListItems not working in Chrome & firefox

    function GetListItems() {
       
        var soapEnv = "<?xml version='1.0' encoding='utf-8'?><soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>" +
             "<soap:Body> " +
             "<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> " +
              "<listName>SomeList</listName> " +
               "<query><Query><Where><Gt><FieldRef Name='ID' /><Value Type='Counter'>1</Value></Gt></Where></Query></query> " +
              " <viewFields> <ViewFields> <FieldRef Name='SomeContent' /></ViewFields></viewFields> " +
              "<rowLimit>100</rowLimit>" +
             "<queryOptions xmlns:SOAPSDK9='http://schemas.microsoft.com/sharepoint/soap/' ><QueryOptions/> " +
            "</queryOptions> </GetListItems></soap:Body> </soap:Envelope>";
      

        jQuery.ajax({
            url: "http://sharepointsiteurl/_vti_bin/lists.asmx",
            
            type: "POST",
            dataType: "xml",
            data: soapEnv,
            error: ErrorFunc,
            complete:GetListItemsComplete,
            contentType: "text/xml; charset=\"utf-8\""
        });
    }
    function ErrorFunc(xData, status) {
        debugger;
        alert(xData.responseText);
    }
    function GetListItemsComplete(xData, status) {

        var a = xData.responseText;
        alert(a);
        $(xData.responseXML).find("z\\:row").each(function () {
            var title = $(this).attr("ows_SomeContent");
            $($(this).attr("ows_SomeContent")).appendTo("#Announcements");
        });

    }
   
</script>
<a href="#" onclick="Javascript:GetListItems();">Get List Items</a>
<div id="Announcements">
</div>
Any help will be appreciated...