Authentication problem with JQuery and SharePoint Web Service -
I am calling a SharePoint Web Service (Webs.asmx) with JQuery to get a list of all subsites :
$ (document) .ready (function () {var hrefParts = window.location.href.split ('/'); wsURL = ""; (i = 0; i & Lt; (hrefParts.length - 2); i ++) {if (i>; 0) wsURL + = "/"; wsURL + = hrefParts [i];} wsURL + = "/_vti_bin/Webs.asmx "; Var soapEnv =" soapenv: envelope xmlns: soapenv = 'http: //schemas.xmlsoap.org/soap/envelope/'> \ & lt; soapenv: body & gt; \ & lt; getAllSubWebCollection xmlns = 'Http: //schemas.microsoft.com/ SharePoint / Soap /' & gt; \ lt; / GetAllSubWebCollection & gt; \ & lt; / soapenv: body & gt; \ & lt; / soapenv: envelope & gt; ; "$ .ajax ({url: wsURL, First send: function (xhr) {xhr setRequestHeader ("SOAPAction", "Http://schemas.microsoft.com/sharepoint/soap/GetAllSubWebCollection");}, type: "post", datatype: "xml", data : SoapEnv, complete: processResult, error: function (XHR, hey) {warning ("readyState:" + xhr.readyState + "\ nstatus:" + xhr.status); Warning ("response text:" + xhr.responseText); }, ContentType: "text / xml; charset = \" utf-8 \ ""}); }); Cause function for beforeSend processResult (xData, status) {...}
A login problem However, I always get. If I comment on this, I get the "Access Denied" error page from SharePoint. I have access to the "full control" site and all the subsites.
What can be the problem here?
The use of the site collection administrator for this operation is necessary, even full control is not enough is.
You will need to iterate through GetWebCollection instead, or create a proxy page that runs with high privileges and gives webservice feedback.
Comments
Post a Comment