Function
$().SPServices
Supported Web Services
The table below shows the Web Services for which we have implemented at least one operation (or have operations coming in planned releases) with a link to more detailed documentation, indicators for whether the Web Service is available in WSS 3.0 and/or MOSS, and links to the MSDN documentation pages.
General Syntax
$().SPServices({
operation: "operationname", // Name of the operation
[option1: value1,] // Options, as listed above
[option2: value2,] //
[async: false,] // By default, all of the Web Service operations are called asynchronously. Generally, this
// will be the desired approach; to force synchronicity, add the async: false option.
completefunc: function (xData, Status) { // Function to call on completion
...do stuff...
}
});
Example
Example call for GetUserInfo:
waitMessage = "<table width='100%' align='center'><tr><td align='center'><img src='/_layouts/images/gears_an.gif'/></td></tr></table>";
$("#WSOutput").html(waitMessage).SPServices({
operation: "GetUserInfo",
userLoginName: "SHARE1\\demouser",
completefunc: function (xData, Status) {
$("#WSOutput").html("").append("<b>This is the output from the GetUserInfo operation:</b>");
$(xData.responseXML).find("User").each(function() {
$("#WSOutput").append("<li>ID: " + $(this).attr("ID") + "</li>");
$("#WSOutput").append("<li>Sid: " + $(this).attr("Sid") + "</li>");
$("#WSOutput").append("<li>Name: " + $(this).attr("Name") + "</li>");
$("#WSOutput").append("<li>LoginName: " + $(this).attr("LoginName") + "</li>");
$("#WSOutput").append("<li>Email: " + $(this).attr("Email") + "</li>");
$("#WSOutput").append("<li>Notes: " + $(this).attr("Notes") + "</li>");
$("#WSOutput").append("<li>IsSiteAdmin: " + $(this).attr("IsSiteAdmin") + "</li>");
$("#WSOutput").append("<li>IsDomainGroup: " + $(this).attr("IsDomainGroup") + "</li>");
$("#WSOutput").append("<hr/>");
});
}
});