开发者

SharePoint JQuery GetUserLoginFromEmail

开发者 https://www.devze.com 2023-01-30 04:35 出处:网络
Could someone provide an an example of how to call the SharePoint WebService开发者_运维百科, \"GetUserLoginFromEmail\"?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消