Could someone provide an an example of how to call the SharePoint WebService开发者_运维百科, "GetUserLoginFromEmail"?
Thanks!
Here you go:
var xml = '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">';
xml += ' <soap:Body>';
xml += ' <GetUserLoginFromEmail xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/">';
xml += ' <emailXml><Users><User Email="somename@email.com"/></Users></emailXml>';
xml += ' </GetUserLoginFromEmail>';
xml += ' </soap:Body>';
xml += '</soap:Envelope>';
$.ajax({
type: 'POST',
url: '/_vti_bin/usergroup.asmx',
dataType: 'xml',
contentType: "text/xml; charset=utf-8",
data: xml,
success: function(data) {
// data is here. You can use .attr("Attribute") to get, well, attributes!
console.log($(data).find("User"));
}
});
I highly recommend getting the jQuery Library for SharePoint Web Services (SPServices) from CodePlex: http://spservices.codeplex.com
It will give you a wrapper for that call and every other SharePoint web service there is.
加载中,请稍侯......
精彩评论