This class provides an easy to use interface for HTTP-GET and HTTP-POST requests.
Example #1
0
        /// <summary>
        /// Protected constructor for the abstract class.
        /// </summary>
        /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param>
        /// <param name="featureTypeInfo">A <see cref="WfsFeatureTypeInfo"/> instance providing metadata of the featuretype to query</param>
        protected GeometryFactory(HttpClientUtil httpClientUtil, WfsFeatureTypeInfo featureTypeInfo)
        {
            FeatureTypeInfo = featureTypeInfo;
            _httpClientUtil = httpClientUtil;
            CreateReader(httpClientUtil);

            try
            {
                if (featureTypeInfo.LableField != null)
                {
                    LabelNode = new PathNode(FeatureTypeInfo.FeatureTypeNamespace, featureTypeInfo.LableField, 
                                              (NameTable) XmlReader.NameTable);
                }
            }
            catch (Exception ex)
            {
                Trace.TraceError("An exception occured while initializing the label path node! " + ex.Message);
                throw;
            }

            InitializePathNodes();
            InitializeSeparators();
        }
 /// <summary>
 /// This method invokes the corresponding method of the inherent <see cref="IXPathQueryManager"/> instance.
 /// </summary>
 /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param>
 public virtual void SetDocumentToParse(HttpClientUtil httpClientUtil)
 {
     XPathQueryManager.SetDocumentToParse(httpClientUtil);
 }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="XPathQueryManager"/> class. 
 /// </summary>
 /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param>
 public XPathQueryManager(HttpClientUtil httpClientUtil)
 {
     SetDocumentToParse(httpClientUtil);
 }
Example #4
0
 /// <summary>
 /// Sets a new XML document. 
 /// </summary>
 /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param>
 public void SetDocumentToParse(HttpClientUtil httpClientUtil)
 {
     try
     {
         InitializeXPathObjects(httpClientUtil.GetDataStream());
     }
     finally
     {
         httpClientUtil.Close();
     }
 }
Example #5
0
            /// <summary>
            /// Configures for WFS 'GetFeature' request using an instance implementing <see cref="IWFS_TextResources"/>.
            /// The <see cref="HttpClientUtil"/> instance is returned for immediate usage. 
            /// </summary>
            internal void ConfigureForWfsGetFeatureRequest(HttpClientUtil httpClientUtil, 
                WfsFeatureTypeInfo featureTypeInfo, string labelProperty, BoundingBox boundingBox,
                IFilter filter, bool get)
            {
                httpClientUtil.Reset();
                httpClientUtil.Url = featureTypeInfo.ServiceUri;

                if (get)
                {
                    /* HTTP-GET */
                    httpClientUtil.Url += _wfsTextResources.GetFeatureGETRequest(
                        featureTypeInfo, labelProperty, boundingBox, filter);
                }

                /* HTTP-POST */
                httpClientUtil.PostData = _wfsTextResources.GetFeaturePOSTRequest(
                    featureTypeInfo, labelProperty, boundingBox, filter);
                httpClientUtil.AddHeader(HttpRequestHeader.ContentType.ToString(), "text/xml");
            }
Example #6
0
 /// <summary>
 /// Configures for WFS 'GetCapabilities' request using an instance implementing <see cref="IWFS_TextResources"/>.
 /// The <see cref="HttpClientUtil"/> instance is returned for immediate usage. 
 /// </summary>
 internal HttpClientUtil ConfigureForWfsGetCapabilitiesRequest(HttpClientUtil httpClientUtil,
                                                               string targetUrl)
 {
     httpClientUtil.Reset();
     httpClientUtil.Url = targetUrl + _wfsTextResources.GetCapabilitiesRequest();
     return httpClientUtil;
 }
Example #7
0
 /// <summary>
 /// Configures for WFS 'DescribeFeatureType' request using an instance implementing <see cref="IWFS_TextResources"/>.
 /// The <see cref="HttpClientUtil"/> instance is returned for immediate usage. 
 /// </summary>
 internal HttpClientUtil ConfigureForWfsDescribeFeatureTypeRequest(HttpClientUtil httpClientUtil,
                                                                   string targetUrl,
                                                                   string featureTypeName)
 {
     httpClientUtil.Reset();
     httpClientUtil.Url = targetUrl + _wfsTextResources.DescribeFeatureTypeRequest(featureTypeName);
     return httpClientUtil;
 }
Example #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UnspecifiedGeometryFactory_WFS1_0_0_GML2"/> class.
 /// </summary>
 /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param>
 /// <param name="featureTypeInfo">A <see cref="WfsFeatureTypeInfo"/> instance providing metadata of the featuretype to query</param>
 /// <param name="multiGeometries">A boolean value specifying whether multi-geometries should be created</param>
 /// <param name="quickGeometries">A boolean value specifying whether the factory should create geometries quickly, but without validation</param>
 internal UnspecifiedGeometryFactory_WFS1_0_0_GML2(HttpClientUtil httpClientUtil,
                                                   WfsFeatureTypeInfo featureTypeInfo, bool multiGeometries,
                                                   bool quickGeometries)
     : base(httpClientUtil, featureTypeInfo)
 {
     _httpClientUtil = httpClientUtil;
     _multiGeometries = multiGeometries;
     _quickGeometries = quickGeometries;
 }
Example #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MultiPolygonFactory"/> class.
 /// </summary>
 /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param>
 /// <param name="featureTypeInfo">A <see cref="WfsFeatureTypeInfo"/> instance providing metadata of the featuretype to query</param>
 internal MultiPolygonFactory(HttpClientUtil httpClientUtil, WfsFeatureTypeInfo featureTypeInfo) 
     : base(httpClientUtil, featureTypeInfo)
 {
 }
Example #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MultiLineStringFactory"/> class.
 /// </summary>
 /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param>
 /// <param name="featureTypeInfo">A <see cref="WfsFeatureTypeInfo"/> instance providing metadata of the featuretype to query</param>
 internal MultiLineStringFactory(HttpClientUtil httpClientUtil, WfsFeatureTypeInfo featureTypeInfo) 
     : base(httpClientUtil, featureTypeInfo)
 {
 }
Example #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PointFactory"/> class.
 /// </summary>
 /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param>
 /// <param name="featureTypeInfo">A <see cref="WfsFeatureTypeInfo"/> instance providing metadata of the featuretype to query</param>
 internal PointFactory(HttpClientUtil httpClientUtil, WfsFeatureTypeInfo featureTypeInfo) 
     : base(httpClientUtil, featureTypeInfo)
 {
 }
Example #12
0
 /// <summary>
 /// This method initializes the XmlReader member.
 /// </summary>
 /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param>
 private void CreateReader(HttpClientUtil httpClientUtil)
 {
     var xmlReaderSettings = new XmlReaderSettings
         {
             IgnoreComments = true,
             IgnoreProcessingInstructions = true,
             IgnoreWhitespace = true,
             DtdProcessing = DtdProcessing.Prohibit
         };
     XmlReader = XmlReader.Create(httpClientUtil.GetDataStream(), xmlReaderSettings);
 }
Example #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MultiPolygonFactory"/> class.
 /// </summary>
 /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param>
 /// <param name="featureTypeInfo">A <see cref="WfsFeatureTypeInfo"/> instance providing metadata of the featuretype to query</param>
 internal MultiPolygonFactory(HttpClientUtil httpClientUtil, WfsFeatureTypeInfo featureTypeInfo)
     : base(httpClientUtil, featureTypeInfo)
 {
 }
Example #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MultiLineStringFactory"/> class.
 /// </summary>
 /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param>
 /// <param name="featureTypeInfo">A <see cref="WfsFeatureTypeInfo"/> instance providing metadata of the featuretype to query</param>
 internal MultiLineStringFactory(HttpClientUtil httpClientUtil, WfsFeatureTypeInfo featureTypeInfo)
     : base(httpClientUtil, featureTypeInfo)
 {
 }
Example #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PointFactory"/> class.
 /// </summary>
 /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param>
 /// <param name="featureTypeInfo">A <see cref="WfsFeatureTypeInfo"/> instance providing metadata of the featuretype to query</param>
 internal PointFactory(HttpClientUtil httpClientUtil, WfsFeatureTypeInfo featureTypeInfo)
     : base(httpClientUtil, featureTypeInfo)
 {
 }