Example #1
0
            private void _InitTokenInfo(string serviceUrl, NetworkCredential credentials)
            {
                var client = ServiceHelper.CreateServiceClient <ServiceCatalogPortClient>(
                    "CatalogServiceBinding",
                    serviceUrl);

                // legal way to disable channel factory caching
                System.ServiceModel.ChannelFactory <ServiceCatalogPort> cf = client.ChannelFactory;

                try
                {
                    // set credentials to SOAP client if needed
                    if (_requiresHttpAuthentication && credentials != null)
                    {
                        ServiceHelper.SetClientCredentials(client,
                                                           credentials);
                    }

                    // check if server requires token authentication
                    if (client.RequiresTokens())
                    {
                        _tokenServiceUrl = client.GetTokenServiceURL();
                        _requiresTokens  = true;
                    }
                    else
                    {
                        _requiresTokens = false;
                    }
                }
                finally
                {
                    ServiceHelper.CloseCommObject(client);
                }
            }
        protected override MapServerPortClient CreateInnerClient(
            string url)
        {
            Debug.Assert(url != null);

            return(ServiceHelper.CreateServiceClient <MapServerPortClient>(
                       "MapServiceBinding",
                       url));
        }
Example #3
0
        protected override NAServerPortClient CreateInnerClient(
            string url)
        {
            var serviceUrl = this.QueryServiceUrl(url);

            return(ServiceHelper.CreateServiceClient <NAServerPortClient>(
                       "NAServiceBinding",
                       serviceUrl));
        }
        protected override GPServerPortClient CreateInnerClient(
            string url)
        {
            Debug.Assert(url != null);

            var serviceUrl = this.QueryServiceUrl(url);

            return(ServiceHelper.CreateServiceClient <GPServerPortClient>(
                       "GPServiceBinding",
                       serviceUrl));
        }
        protected override GeocodeServerPortClient CreateInnerClient(
            string url)
        {
            Debug.Assert(url != null);

            var client = ServiceHelper.CreateServiceClient <GeocodeServerPortClient>(
                "GeocodeServiceBinding",
                url);

            client.ReverseGeocodeCompleted += new EventHandler <ReverseGeocodeCompletedEventArgs>(_ReverseGeocodeCompleted);

            return(client);
        }
Example #6
0
        /// <summary>
        /// Queries load-balancing service for routing service url.
        /// </summary>
        /// <returns>Result of the url request.</returns>
        /// <exception cref="ESRI.ArcLogistics.CommunicationException">An error
        /// occured during retrieval of the service url.
        /// </exception>
        private LoadBalanceResult _GetServiceUrl()
        {
            var result = default(LoadBalanceResult);

            _serviceWrapper.Invoke(() =>
            {
                var client = ServiceHelper.CreateServiceClient <LoadBalanceServiceSoapClient>(
                    "LoadBalanceServiceBinding",
                    _serviceUrl);

                try
                {
                    result = client.GetServiceUrl();
                }
                finally
                {
                    ServiceHelper.CloseCommObject(client);
                }
            });

            return(result);
        }