Esempio n. 1
0
        /// <summary>
        /// Register WCF client proxies for the various MLS services.
        /// </summary>
        /// <remarks>
        /// NOTE: The binding parameters used here MUST agree with those used on
        /// the server side, otherwise you will get errors when attempting to make
        /// requests.
        /// </remarks>

        private void SetupServices()
        {
            using (IWCFHelper helper = container.Resolve <IWCFHelper>())
                using (IAppSettings settings = container.Resolve <IAppSettings>())
                {
                    var sendTimeout    = new TimeSpan(0, settings.WCFSendTimeoutInMinutes, 0);
                    var receiveTimeout = new TimeSpan(0, settings.WCFReceiveTimeoutInMinutes, 0);

                    var maxMsgSize = settings.MaxReceivedMessageSize;
                    helper.RegisterWCFClientProxy <IContentServiceSecure>(settings.ContentServiceSecureEndPoint, true, maxMsgSize, sendTimeout, receiveTimeout);
                    helper.RegisterWCFClientProxy <IContentServiceAdmin>(settings.ContentServiceAdminEndPoint, true, maxMsgSize, sendTimeout, receiveTimeout);
                    helper.RegisterWCFClientProxy <IUserServiceSecure>(settings.UserServiceSecureEndPoint, true, maxMsgSize, sendTimeout, receiveTimeout);
                    helper.RegisterWCFClientProxy <IAdminService>(settings.AdminServiceEndPoint, false, maxMsgSize, sendTimeout, receiveTimeout);
                }
        }
Esempio n. 2
0
        private WCFWrapper()
        {
            var URL = ConfigurationManager.AppSettings["urlServices"];

            if (URL != null && URL.ToLower().StartsWith("net.tcp"))
            {
                wcfHelper = new WCFTcpHelper();
                IsTcp     = true;
            }
            else
            {
                IsTcp     = false;
                wcfHelper = new ApiWCFHelper();
            }
        }