private void VerifyPassword(string userName, string password)
{
if (String.IsNullOrEmpty(password))
{
// construct translation object with default text.
TranslationInfo info = new TranslationInfo(
"InvalidPassword",
"en-US",
"Specified password is not valid for user '{0}'.",
userName);
// create an exception with a vendor defined sub-code.
throw new ServiceResultException(new ServiceResult(
StatusCodes.BadIdentityTokenRejected,
"InvalidPassword",
"http://opcfoundation.org/UA/Sample/",
new LocalizedText(info)));
}
}