internal static string GetMessagingWebToken(this TokenProvider tokenProvider, Uri namespaceAddress, string appliesTo, string action, bool bypassCache, TimeSpan timeout)
        {
            string str;

            try
            {
                str = tokenProvider.EndGetWebToken(tokenProvider.BeginGetWebToken(namespaceAddress, appliesTo, action, bypassCache, timeout, null, null));
            }
            catch (TimeoutException timeoutException)
            {
                throw;
            }
            catch (TokenProviderException tokenProviderException1)
            {
                TokenProviderException tokenProviderException = tokenProviderException1;
                throw new MessagingException(tokenProviderException.Message, tokenProviderException);
            }
            catch (Exception exception1)
            {
                Exception exception = exception1;
                if (!Fx.IsFatal(exception))
                {
                    throw new UnauthorizedAccessException(exception.Message, exception);
                }
                throw;
            }
            return(str);
        }
 internal static string GetWebToken(this TokenProvider tokenProvider, string appliesTo, string action, bool bypassCache, TimeSpan timeout)
 {
     return(tokenProvider.EndGetWebToken(tokenProvider.BeginGetWebToken(appliesTo, action, bypassCache, timeout, null, null)));
 }