public RoutingServiceClientBase(
     string url,
     AgsServerConnection connection)
     : base(url, connection)
 {
     _serviceUrl            = connection.Url;
     this.PersistConnection = false;
 }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="url">Service url.</param>
        /// <param name="connection">ArcGIS Server Connection.</param>
        public DiscoveryClient(string url, AgsServerConnection connection)
        {
            Debug.Assert(!string.IsNullOrEmpty(url));
            Debug.Assert(connection != null);

            _serviceUrl = url;
            _connection = connection;
        }
        /// <summary>
        /// Initializes a new instance of the RequestContext class with
        /// the specified connection and known types.
        /// </summary>
        /// <param name="connection">Instance of the connection to the ArcGIS
        /// server hosting REST service.</param>
        /// <param name="knownTypes">collection of types that might be present
        /// in REST service requests and responses.</param>
        public RequestContext(
            AgsServerConnection connection,
            IEnumerable<Type> knownTypes)
        {
            Debug.Assert(connection != null);

            Connection = connection;
            KnownTypes = knownTypes;
        }
示例#4
0
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////

        public ServiceClientWrap(string url, AgsServerConnection connection)
        {
            Debug.Assert(url != null);
            Debug.Assert(connection != null);

            _baseUrl    = url;
            _connection = connection;

            this.PersistConnection = true;
        }
示例#5
0
        /// <summary>
        /// Opens connection to the ArcGIS server, performing authentication
        /// if necessary.
        /// </summary>
        /// <returns>New instance of the ArcGIS server connection.</returns>
        /// <exception cref="System.InvalidOperationException">Server is in
        /// unavailable state.</exception>
        /// <exception cref="ESRI.ArcLogistics.AuthenticationException">Failed
        /// to authenticate within ArcGIS server.</exception>
        /// <exception cref="ESRI.ArcLogistics.CommunicationException">Failed
        /// to establish connection to the server.</exception>
        public AgsServerConnection OpenConnection()
        {
            _CheckState();

            AgsServerConnection connection = null;

            try
            {
                var parameters = new AgsServerConnectionParameters(_config)
                {
                    SoapUrl            = _parameters.SoapUrl,
                    Credentials        = _parameters.Credentials,
                    AuthenticationType = _parameters.AuthenticationType
                };

                var authenticator = _authenticator;
                if (_serviceUrlProvider != null)
                {
                    // Get new soap URL.
                    string newSoapUrl = _serviceUrlProvider.QueryServiceUrl();

                    // Replace old url and connect to new one.
                    parameters.SoapUrl = newSoapUrl;
                    authenticator      = new Authenticator(newSoapUrl, _config.TokenType);

                    // Use older authenticator for initialization.
                    authenticator.Initialize(_authenticator);
                }

                connection = new AgsServerConnection(
                    authenticator,
                    parameters,
                    this);
            }
            catch (Exception e)
            {
                if (_IsCommError(e))
                {
                    throw _CreateCommException(e);
                }

                throw;
            }

            return(connection);
        }
 public MapServiceClient(string url, AgsServerConnection connection)
     : base(url, connection)
 {
 }
示例#7
0
        /// <summary>
        /// Opens connection to the ArcGIS server, performing authentication
        /// if necessary.
        /// </summary>
        /// <returns>New instance of the ArcGIS server connection.</returns>
        /// <exception cref="System.InvalidOperationException">Server is in
        /// unavailable state.</exception>
        /// <exception cref="ESRI.ArcLogistics.AuthenticationException">Failed
        /// to authenticate within ArcGIS server.</exception>
        /// <exception cref="ESRI.ArcLogistics.CommunicationException">Failed
        /// to establish connection to the server.</exception>
        public AgsServerConnection OpenConnection()
        {
            _CheckState();

            AgsServerConnection connection = null;
            try
            {
                var parameters = new AgsServerConnectionParameters(_config)
                {
                    SoapUrl = _parameters.SoapUrl,
                    Credentials = _parameters.Credentials,
                    AuthenticationType = _parameters.AuthenticationType
                };

                var authenticator = _authenticator;
                if (_serviceUrlProvider != null)
                {
                    // Get new soap URL.
                    string newSoapUrl = _serviceUrlProvider.QueryServiceUrl();

                    // Replace old url and connect to new one.
                    parameters.SoapUrl = newSoapUrl;
                    authenticator = new Authenticator(newSoapUrl, _config.TokenType);

                    // Use older authenticator for initialization.
                    authenticator.Initialize(_authenticator);
                }

                connection = new AgsServerConnection(
                    authenticator,
                    parameters,
                    this);
            }
            catch (Exception e)
            {
                if (_IsCommError(e))
                {
                    throw _CreateCommException(e);
                }

                throw;
            }

            return connection;
        }