Here's the core routine:
var promiseEmail = $().SPServices({
operation: "GetUserLoginFromEmail",
emailXml: "<Users><User Email='" + whatever + "' /></Users>"
});
promiseEmail.done(function() {
hold = $(promiseEmail.responseXML).SPFilterNode("User").attr("Login");
get_user_profile_by_login(hold);
});
promiseEmail.fail(function() {
hold = promiseEmail.responseText;
var iIndex = hold.indexOf("Login=");
if(iIndex == -1) alert("Whoops! Failed to retrieve logon from email: " + email);
else {
var iEnd = hold.indexOf('"', iIndex+7);
var login = hold.substring(iIndex+7, iEnd);
get_user_profile_by_login(login)
}
});
The done() clause never happens but from fail() I get this:<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetUserLoginFromEmailResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/"><GetUserLoginFromEmailResult><GetUserLoginFromEmail><User Login="WASHDC\singlas" Email="SinglaS@some.org" DisplayName="Sxxx, Sxxx "Monti"" SiteUser="0"></User></GetUserLoginFromEmail></GetUserLoginFromEmailResult></GetUserLoginFromEmailResponse></soap:Body></soap:Envelope>