Jquery 通过SharePoint 2010的Ajax调用使用GetListItems

Jquery 通过SharePoint 2010的Ajax调用使用GetListItems,jquery,ajax,web-services,sharepoint,sharepoint-2010,Jquery,Ajax,Web Services,Sharepoint,Sharepoint 2010,我正在尝试编写一个ajax调用,使用 我一直收到一个302错误,即使我正在正确设置格式。我错过什么了吗 代码 function makeSoapCall(listName){ var soapEnv = "<?xml version='1.0' encoding='utf-8'?> " + "<soap12:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd

我正在尝试编写一个
ajax
调用,使用

我一直收到一个
302
错误,即使我正在正确设置格式。我错过什么了吗

代码

function makeSoapCall(listName){
    var soapEnv =  
    "<?xml version='1.0' encoding='utf-8'?> " +
    "<soap12:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap12='http://www.w3.org/2003/05/soap-envelope'> " +
        "<soap12:Body> " +
            "<GetList xmlns='http://schemas.microsoft.com/sharepoint/soap/'> " +
                "<listName>Webpostings Approvers</listName> " +
            "</GetList> " +
        "</soap12:Body> " +
    "</soap12:Envelope>";

        $.ajax({
            url: "http://webpub.ex.com/_vti_bin/Lists.asmx",
            type: "POST",
            dataType: "xml",
            data: soapEnv,
            contentType: "application/soap+xml; charset=utf-8"
        });
    }
http://webpub.ex.com/_layouts/error.aspx?ErrorText=Request format is unrecognized.

因为您需要列表项。您必须使用Getlistitems而不是Getlist

 function getSharepointListData (myList) {

       var listName = myList;

    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='Author' /> \
                       </ViewFields> \
                    </viewFields> \
                </GetListItems> \
            </soapenv:Body> \
        </soapenv:Envelope>";

    $.ajax({
        url: "http:URL/_vti_bin/lists.asmx",
        type: "POST",
        dataType: "xml",
        data: soapEnv,
        complete: processResult,
        contentType: "text/xml; charset=\"utf-8\""
    });
函数getSharepointListData(myList){ var listName=myList; var soapEnv= " \ \ \ “+listName+”\ \ \ \ \ \ \ \ "; $.ajax({ url:“http:url/_vti_bin/lists.asmx”, 类型:“POST”, 数据类型:“xml”, 数据:soapEnv, 完成:processResult, contentType:“text/xml;字符集=\“utf-8” });