Пример #1
0
        private bool GetRequest(ref NetworkStream stream)
        {
            Byte[] data = new Byte[1024];
            requestData = String.Empty;
            Int32 bytes = stream.Read(data, 0, data.Length);

            requestData = System.Text.Encoding.ASCII.GetString(data, 0, bytes);
            Console.WriteLine(requestData);
            try
            {
                if (requestData.IndexOf("Capabilities") != -1)  //请求是GetCapabilities
                {
                    capalitityReq = new CapabilityRequest(requestData);
                    serveType     = ServiceOperations.GetCapabilities;
                    sMimeType     = "text/xml";
                }
                else  //请求是GetMap
                {
                    mapReq    = new MapRequest(requestData);
                    serveType = ServiceOperations.GetMap;
                    sMimeType = mapReq.FORMAT;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(true);
        }
Пример #2
0
 public static Byte[] GetCapabilityData(CapabilityRequest req)
 {
     return(Encoding.UTF8.GetBytes(WMSServer.Properties.Resources.capability));
 }