Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NsiClientWS"/> class.
        /// </summary>
        /// <param name="config">
        /// The config
        /// </param>
        public NsiClientWSV21(WsInfo config)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            if (string.IsNullOrEmpty(config.EndPoint))
            {
                throw new ArgumentException(Resources.ExceptionEndpointNotSet, "config");
            }

            //getting nsiClientWs
            WsInfo wsInfo = new WsInfo(config.Config, SdmxSchemaEnumType.VersionTwo);

            _nsiClientWs = new NsiClientWS(wsInfo);

            Logger.Info(Resources.InfoCreatingNsiClient);
            _config = config;
            Logger.Info(Resources.InfoGetWSDL);
            try
            {
                this._wsdlConfig = new WSDLSettings(config);
                Logger.Info(Resources.InfoWSDLSuccess);
            }
            catch (WebException ex)
            {
                throw NsiClientHelper.HandleWsdlException(config.EndPoint, ex, config.Wsdl);
            }
            catch (InvalidOperationException ex)
            {
                throw NsiClientHelper.HandleWsdlException(config.EndPoint, ex, config.Wsdl);
            }
            catch (UriFormatException ex)
            {
                throw NsiClientHelper.HandleWsdlException(config.EndPoint, ex, config.Wsdl);
            }

            this._defaultHeader = new HeaderImpl("NSIClient", "NSIClient");
            Utils.PopulateHeaderFromSettings(this._defaultHeader);
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NsiClientWSRest"/> class.
        /// </summary>
        /// <param name="config">
        /// The config
        /// </param>
        public NsiClientWSRest(WsInfo config)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            if (string.IsNullOrEmpty(config.EndPoint))
            {
                throw new ArgumentException(Resources.ExceptionEndpointNotSet, "config");
            }

            // Getting nsiClientWs
            WsInfo wsInfo = new WsInfo(config.Config, SdmxSchemaEnumType.VersionTwo);

            this._nsiClientWs = new NsiClientWS(wsInfo);

            Logger.Info(Resources.InfoCreatingNsiClient);
            this._config = config;

            this._defaultHeader = new HeaderImpl("NSIClient", "NSIClient");
            Utils.PopulateHeaderFromSettings(this._defaultHeader);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="NsiClientWSRest"/> class. 
        /// </summary>
        /// <param name="config">
        /// The config
        /// </param>
        public NsiClientWSRest(WsInfo config)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            if (string.IsNullOrEmpty(config.EndPoint))
            {
                throw new ArgumentException(Resources.ExceptionEndpointNotSet, "config");
            }

            // Getting nsiClientWs
            WsInfo wsInfo = new WsInfo(config.Config, SdmxSchemaEnumType.VersionTwo);
            this._nsiClientWs = new NsiClientWS(wsInfo);

            Logger.Info(Resources.InfoCreatingNsiClient);
            this._config = config;

            this._defaultHeader = new HeaderImpl("NSIClient", "NSIClient");
            Utils.PopulateHeaderFromSettings(this._defaultHeader);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="NsiClientWS"/> class. 
        /// </summary>
        /// <param name="config">
        /// The config
        /// </param>
        public NsiClientWSV21(WsInfo config)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            if (string.IsNullOrEmpty(config.EndPoint))
            {
                throw new ArgumentException(Resources.ExceptionEndpointNotSet, "config");
            }

            //getting nsiClientWs
            WsInfo wsInfo = new WsInfo(config.Config, SdmxSchemaEnumType.VersionTwo);
            _nsiClientWs = new NsiClientWS(wsInfo);

            Logger.Info(Resources.InfoCreatingNsiClient);
            _config = config;
            Logger.Info(Resources.InfoGetWSDL);
            try
            {
                this._wsdlConfig = new WSDLSettings(config);
                Logger.Info(Resources.InfoWSDLSuccess);
            }
            catch (WebException ex)
            {
                throw NsiClientHelper.HandleWsdlException(config.EndPoint, ex, config.Wsdl);
            }
            catch (InvalidOperationException ex)
            {
                throw NsiClientHelper.HandleWsdlException(config.EndPoint, ex, config.Wsdl);
            }
            catch (UriFormatException ex)
            {
                throw NsiClientHelper.HandleWsdlException(config.EndPoint, ex, config.Wsdl);
            }

            this._defaultHeader = new HeaderImpl("NSIClient", "NSIClient");
            Utils.PopulateHeaderFromSettings(this._defaultHeader);
        }