/// <summary> /// Ctor /// </summary> /// <param name="serviceInfo"></param> /// <param name="serviceUrl"></param> public JsonServiceHandler(IJsonServiceInfo serviceInfo, string serviceUrl) { try { this.ServiceInfo = serviceInfo; this.serviceUrl = serviceUrl; } catch (Exception ex) { this.error = ex; } }
public virtual IHttpHandler GetHandler(HttpContext context, string verb, string url, string path) { if ("GET".Equals(verb, StringComparison.OrdinalIgnoreCase) && String.IsNullOrEmpty(context.Request.PathInfo)) { // output service javascript proxy return(new ResourceHandler(context)); } // handle service requests string appUrl = context.Request.AppRelativeCurrentExecutionFilePath; IJsonServiceInfo serviceInfo = ResourceHandler.Create <IJsonServiceInfo>(appUrl); if (!context.IsDebuggingEnabled && !Settings.DisableStreamCompression) { ResourceHandler.EnableStreamCompression(context); } return(new JsonServiceHandler(serviceInfo, url)); }