Пример #1
0
        public virtual rws.ReportingService2005Soap MakeSsrsSoapClient()
        {
            rws.ReportingService2005SoapClient rService = new rws.ReportingService2005SoapClient("ReportingService2005Soap", GetWebServiceUrl());
            if (GetImpersonateLoggedOnUser())
            {
                logger.DebugFormat("Making Ssrs Soap client with impersonation of logged in user");
                rService.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
                rService.ChannelFactory.Credentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;
            }
            else
            {
                // NB: for this to work properly, ApplicationPool account should match crisscross.FixedSsrsUsername account in web.config
                logger.DebugFormat("Making Ssrs Soap client with default network credentials (ie Application Pool credentials)");
                rService.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
                rService.ChannelFactory.Credentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;
            }

            return (rws.ReportingService2005Soap) rService;
        }
Пример #2
0
        public virtual rws.ReportingService2005Soap MakeSsrsSoapClient()
        {
            rws.ReportingService2005SoapClient rService = new rws.ReportingService2005SoapClient("ReportingService2005Soap", GetWebServiceUrl());
            if (GetImpersonateLoggedOnUser())
            {
                logger.DebugFormat("Making Ssrs Soap client with impersonation of logged in user");
                rService.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
                rService.ChannelFactory.Credentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;
            }
            else
            {
                // NB: for this to work properly, ApplicationPool account should match crisscross.FixedSsrsUsername account in web.config
                logger.DebugFormat("Making Ssrs Soap client with default network credentials (ie Application Pool credentials)");
                rService.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
                rService.ChannelFactory.Credentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;
            }

            return((rws.ReportingService2005Soap)rService);
        }