0
Ajax調用使用GetListItems我試圖寫一個ajax
呼叫從SharePoint檢索列表項使用Lists.asmx與從SharePoint 2010
我不斷收到即使我正確folling格式化一個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.