HttpContext context in WMS server

Topics: SharpMap Project, Web Controls
Developer
Jan 2, 2013 at 6:32 AM
Edited Jan 2, 2013 at 6:43 AM

Hi,

In the WMS Server Parse QueryString, is there any reason why the HTTP context is being picked up using

if (HttpContext.Current == null)
  throw (new ApplicationException("An attempt was made to access the WMS server outside a valid HttpContext"));

  HttpContext context = HttpContext.Current;

moving this section of the code to an overload like so will allow the user to inject the context more freely.

 

public static void ParseQueryString(Map map, Capabilities.WmsServiceDescription description)
{
  if (HttpContext.Current == null)
       throw (new ApplicationException(
         "An attempt was made to access the WMS server outside a valid HttpContext"));

  ParseQueryString(map, description, HttpContext.Current);
 }

then the original function will look like

 

 

public static void ParseQueryString(Map map, Capabilities.WmsServiceDescription description, HttpContext context)

{

/// Original Implementation

}
Coordinator
Jan 2, 2013 at 6:56 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.