Domanda

I am trying to populate a gadget with a sharepoint list, but I couldn't find any way or tutorial on google to help me with this, however I find this tutorial that is getting the XML feedbacks of a news website, and displaying them in a list.

Tutorial for Making a Gadget that gets XML feedbacks off a news Site

Now Instead of getting XML feedback from that News Website, I want this tutorial to display items of XML document I will get throught this piece of code,

$(document).ready(function() 
{
    var soapEnv =
        "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> 
            <soapenv:Body> 
                 <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> 
                    <listName>ListName</listName> 
                    <viewFields> 
                        <ViewFields> 
                           <FieldRef Name='Title' /> 
                       </ViewFields> 
                    </viewFields> 
                </GetListItems> 
            </soapenv:Body> 
        </soapenv:Envelope>";

    $.ajax({
        url: "http://my_site/_vti_bin/lists.asmx",
        type: "POST",
        dataType: "xml",
        data: soapEnv,
        complete: processResult,
        contentType: "text/xml; charset="utf-8""
    });
});

function processResult(xData, status) {
    $(xData.responseXML).find("z\:row").each(function() {
        alert($(this).attr("ows_Title"));
    });
}

I got no clue about how can i do this trick, but please can you atleast just guide me, how can i accomplish this task, + what things should i look into or learn, as google is not helping me with my queries at all :/.

È stato utile?

Soluzione

Instead of using soap requests and query through /_vti_bin/lists.asmx good option is to use SPServices library, which is a simplest way to get data without digging into soap requests. there are many simple examples, try it out!

But, if it is compulsory to stick to soap implementation, there are two tools that can help you soapUI and fiddler.

with the help of soapUI, you will be able to create a soap request easily from url you have. You can inspect request and response using fiddler.

Let me know if you have more questions

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top