示例#1
0
        protected virtual T GetCachedProxy <T>(bool secureCalls)
        {
            Type   t     = typeof(T);
            string key   = t.FullName + ".ServiceProxy";
            T      proxy = (T)HttpContext.Current.Items[key];

            if (proxy == null)
            {
                proxy = (T)Activator.CreateInstance(t);
                HttpContext.Current.Items[key] = proxy;
            }

            object p = proxy;

            // configure proxy
            PortalUtils.ConfigureEnterpriseServerProxy((WebServicesClientProtocol)p, secureCalls);

            return(proxy);
        }