Пример #1
0
        /// <summary>
        /// Creates a new instance of a WaterOneFlow web service client
        /// which communicates with the specified web service.
        /// </summary>
        /// <param name="serviceInfo">The object with web service information</param>
        /// <remarks>Throws an exception if the web service is not a valid
        /// WaterOneFlow service</remarks>
        public WaterOneFlowClient(DataServiceInfo serviceInfo)
        {
            //check if the web service is a valid web service.
            //this will throw an exception when the web service URL is invalid.
            CheckWebService(serviceInfo.EndpointURL);
            _asmxURL = serviceInfo.EndpointURL;

            //TODO make this path an optional user setting
            DownloadDirectory = Path.Combine(Path.GetTempPath(), "HydroDesktop");

            //find out the WaterOneFlow version of this web service
            _serviceInfo = serviceInfo;
            AssignWaterOneFlowVersion(_serviceInfo);

            //assign the waterOneFlow parser
            //the parser is automatically set depending on service version information
            //in the WaterML file
            if (ServiceInfo.Version == 1.0)
            {
                _parser = new WaterOneFlow10Parser();
            }
            else
            {
                _parser = new WaterOneFlow11Parser();
            }
        }
Пример #2
0
        /// <summary>
        /// Creates a new instance of a WaterOneFlow web service client
        /// which communicates with the specified web service.
        /// </summary>
        /// <param name="serviceInfo">The object with web service information</param>
        /// <remarks>Throws an exception if the web service is not a valid
        /// WaterOneFlow service</remarks>
        public WaterOneFlowClient(DataServiceInfo serviceInfo)
        {
            _serviceURL = serviceInfo.EndpointURL;

            //find out the WaterOneFlow version of this web service
            _serviceInfo = serviceInfo;
            _serviceInfo.Version = WebServiceHelper.GetWaterOneFlowVersion(_serviceURL);

            //assign the waterOneFlow parser
            _parser = new ParserFactory().GetParser(ServiceInfo);

            SaveXmlFiles = true; // for backward-compatibility
        }
Пример #3
0
        /// <summary>
        /// Creates a new instance of a WaterOneFlow web service client
        /// which communicates with the specified web service.
        /// </summary>
        /// <param name="serviceInfo">The object with web service information</param>
        /// <remarks>Throws an exception if the web service is not a valid
        /// WaterOneFlow service</remarks>
        public WaterOneFlowClient(DataServiceInfo serviceInfo)
        {
            _serviceURL = serviceInfo.EndpointURL;

            //find out the WaterOneFlow version of this web service
            _serviceInfo         = serviceInfo;
            _serviceInfo.Version = WebServiceHelper.GetWaterOneFlowVersion(_serviceURL);

            //assign the waterOneFlow parser
            _parser = new ParserFactory().GetParser(ServiceInfo);

            SaveXmlFiles = false; // false on webserver
        }