public static IGetSDMX GetSdmxImplementation(EndpointSettings endpoint)
        {
            IGetSDMX obj = null;
            try
            {
                switch (endpoint._TypeEndpoint)
                {
                    case ISTAT.WebClient.WidgetComplements.Model.Enum.EndpointType.V20:
                        obj = new GetSDMX_WSV20(endpoint);
                        break;
                    case ISTAT.WebClient.WidgetComplements.Model.Enum.EndpointType.V21:
                        obj = new GetSDMX_WSV21(endpoint);
                        break;
                    case ISTAT.WebClient.WidgetComplements.Model.Enum.EndpointType.REST:
                        obj = new GetSDMX_WSRest(endpoint);
                        break;
                }
            }
            catch { }

            return obj;
        }
 /// <summary>
 /// Setter for NSI Client settings
 /// The settings are used for Proxy and HTTP authentication
 /// </summary>
 /// <param name="config">
 /// The NSI Client settings
 /// </param>
 public void SetConfig(EndpointSettings config)
 {
     this._config = config;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="GetSDMX_WSV20"/> class. 
        /// </summary>
        /// <param name="config">
        /// The config
        /// </param>
        public GetSDMX_WSV21(EndpointSettings config)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

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

            //getting nsiClientWs
            EndpointSettings V20Sett = (EndpointSettings)config.Clone();
            V20Sett.EndPointType = "V20";
            V20Sett.EndPoint = V20Sett.EndPointV20;
            _nsiClientWs = new GetSDMX_WSV20(V20Sett);

            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);
        }
 public EndpointSettings(EndpointSettings endpointSetting)
 {
     // TODO: Complete member initialization
     this.endpointSetting = endpointSetting;
 }
Esempio n. 5
0
 public CacheTree(string ConnectionString, EndpointSettings config)
 {
     Sqlconn = new SqlConnection(ConnectionString);
     conf = config;
 }
        public GetEndpointSettings LoadFile()
        {
            GetEndpointSettings ret = new GetEndpointSettings();
            ret.settings = new Settings();
            ret.settings.view_tree = true;
            ret.settings.view_tree_req = true;
            ret.settings.view_tree_select = true;
            ret.settings.view_login = false;

            EndpointSettings endpointSetting = new EndpointSettings();
            ret.endpoints = new List<EndpointSettings>();
            foreach (EndPointElement endPointEl in IRConfiguration.Config.EndPoints)
            {
                endpointSetting = new EndpointSettings();
                endpointSetting.Locale = endPointEl.Locale;
                endpointSetting.IDNode = endPointEl.IDNode;
                endpointSetting.Title = endPointEl.Title;
                endpointSetting.DecimalSeparator = endPointEl.DecimalSeparator;
                endpointSetting.Domain = endPointEl.Domain;
                endpointSetting.EnableHTTPAuthentication = endPointEl.EnableHTTPAuthentication;
                endpointSetting.EnableProxy = endPointEl.EnableProxy;
                endpointSetting.EndPoint = endPointEl.EndPoint;
                endpointSetting.EndPointV20 = endPointEl.EndPointV20;
                endpointSetting.EndPointType = endPointEl.EndPointType;
                endpointSetting.EndPointSource = endPointEl.EndPointSource;
                endpointSetting.Password = endPointEl.Password;
                endpointSetting.Prefix = endPointEl.Prefix;
                endpointSetting.ProxyPassword = endPointEl.ProxyPassword;
                endpointSetting.ProxyServer = endPointEl.ProxyServer;
                endpointSetting.ProxyServerPort = endPointEl.ProxyServerPort;
                endpointSetting.ProxyUserName = endPointEl.ProxyUserName;
                endpointSetting.UseSystemProxy = endPointEl.UseSystemProxy;
                endpointSetting.UserName = endPointEl.UserName;
                endpointSetting.Wsdl = endPointEl.Wsdl;
                endpointSetting.Active = endPointEl.Active;
                endpointSetting.UseUncategorysed = endPointEl.UseUncategorysed;
                endpointSetting.UseVirtualDf = endPointEl.UseVirtualDf;
                endpointSetting.Ordinamento = endPointEl.Ordinamento;
                //endpointSetting._TypeEndpoint = endPointEl._TypeEndpoint;
                //ret.endpoints.Add(new EndpointSettings(endpointSetting));
                ret.endpoints.Add(endpointSetting);
            }

            return ret;
        }
 public EndpointSettings(EndpointSettings endpointSetting)
 {
     // TODO: Complete member initialization
     this.endpointSetting = endpointSetting;
 }
        public StreamResponseAction ExportSDMXQuery()
        {
            SessionQuery query = SessionQueryManager.GetSessionQuery(Session);

            //ControllerSupport CS = new ControllerSupport();
            //GetCodemapObject PostDataArrived = CS.GetPostData<GetCodemapObject>(this.Request);
            //PostDataArrived.Configuration.Locale = System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName;

            string request = "";
            var xdoc = new XmlDocument();

            EndpointSettings DataObjConfiguration = new EndpointSettings();
            DataObjConfiguration = query._endpointSettings;

            IGetSDMX GetSDMXObject = WebServiceSelector.GetSdmxImplementation(DataObjConfiguration);
            BaseDataObject BDO = new BaseDataObject(DataObjConfiguration, "appo.xml");

            ISdmxObjects structure = query.Structure;
            IDataflowObject df = structure.Dataflows.First();
            IDataStructureObject kf = structure.DataStructures.First();
            IDataQuery sdmxQuery = BDO.CreateQueryBean(df, kf, query.GetCriteria());
            GetSDMXObject.GetSdmxQuery(sdmxQuery, out request);

            string filename = string.Format(CultureInfo.InvariantCulture, "{0}.{1}", query.Dataflow.Id, "xml");

            this.HttpContext.Response.Clear();
            this.HttpContext.Response.ContentType = "text/xml";
            this.HttpContext.Response.ContentEncoding = Encoding.UTF8;
            string contentDisposition = string.Format(
                CultureInfo.InvariantCulture,
                Constants.AttachmentFilenameFormat,
                filename);
            this.HttpContext.Response.AddHeader(Constants.ContentDispositionHttpHeader, contentDisposition);

            this.HttpContext.Response.AddHeader("content-disposition", contentDisposition);
            this.HttpContext.Response.Write(request);
            this.HttpContext.Response.End();
            throw new NotImplementedException();
        }
Esempio n. 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WSDLSettings"/> class. 
 /// Initialize a new instance of the WSDLSettings class with EndpointSettings configuration
 /// </summary>
 /// <param name="config">
 /// The <see cref="EndpointSettings"/> config used to retrieve the WSDL URL and other information such as proxy
 /// </param>
 public WSDLSettings(EndpointSettings config)
 {
     this.GetWSDL(config);
     this.BuildOperationParameterName();
     this.ΒuildSoapActionMap();
 }
Esempio n. 10
0
        /// <summary>
        /// Gets the WSDL.
        /// </summary>
        /// <param name="config">
        /// The config.
        /// </param>
        private void GetWSDL(EndpointSettings config)
        {
            try
            {
                var resolver = new XmlProxyUrlResolver();
                resolver.SetConfig(config);

                var settings = new XmlReaderSettings { IgnoreComments = true, IgnoreWhitespace = true, XmlResolver = resolver };
                string wsdlUrl = config.Wsdl;

                if (string.IsNullOrEmpty(wsdlUrl))
                {
                    wsdlUrl = string.Format(CultureInfo.InvariantCulture, "{0}?wsdl", config.EndPoint);
                }

                //System.Net.WebProxy myProxy = new System.Net.WebProxy();
                //myProxy.UseDefaultCredentials = true;
                //System.Uri newUri = new System.Uri("http://proxy.istat.it:3128");
                //myProxy.Address = newUri;

                System.Net.WebRequest.DefaultWebProxy.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
                System.Net.WebRequest request = System.Net.WebRequest.Create(wsdlUrl);

                request.UseDefaultCredentials = true;

                var webProxy = System.Net.WebProxy.GetDefaultProxy();
                webProxy.UseDefaultCredentials = true;
                request.Proxy = webProxy;

                using (System.Net.WebResponse response = request.GetResponse())
                using (XmlReader reader = XmlReader.Create(response.GetResponseStream()))
                {
                    this._wsdl = ServiceDescription.Read(reader);
                }

                //using (XmlReader reader = XmlReader.Create(wsdlUrl, settings))
                //{
                //    this._wsdl = ServiceDescription.Read(reader);
                //}

            }
            catch(System.Exception ex) {
                System.Console.WriteLine(ex.Message);
            }
        }
 public BaseDataObject(EndpointSettings dataObjConfiguration, string fileTmpData)
 {
     DataObjConfiguration = dataObjConfiguration;
     FileTmpData = fileTmpData;
 }