Class JsonCallbackMethodProcessor

This is the core implementation of the JSON callback method handler that picks up POST data from the request and uses it to call the actual callback method on the specified object and return the results back as JSON.

This processor is generic and can be used easily from anywhere that needs to feed back JSON data from a method callback, simply calling the ProcessCallbackMethod() with an object that contains methods that are marked up with the [CallbackMethod] attribute.

For example, wwCallbackHandler simply forwards all processing like this:

<>public void ProcessRequest(HttpContext context) { // Pass off to the worker Callback Processor ICallbackMethodProcessor processor = new JsonCallbackMethodProcessor();

// Process the inbound request and execute it on this     // Http Handler's methods     processor.ProcessCallbackMethodCall(this); }<</code>>

This processor is expected to execute in an environment where HttpContext.Current is available and where POST data is available to describe the incoming parameter data and method to call.

System.Object
  Westwind.Web.JsonCallbackMethodProcessor
public class JsonCallbackMethodProcessor : object, ICallbackMethodProcessor

Class Members

MemberDescription

Constructor

ProcessCallbackMethodCall

Generic method that handles processing a Callback request by routing to a method in a provided target object.

public void ProcessCallbackMethodCall(object target,     string methodToCall)

public sealed void ProcessCallbackMethodCall(object target)

WriteErrorResponse

Returns an error response to the client from a callback. Code should exit after this call.

public sealed void WriteErrorResponse(string errorMessage,     string stackTrace,     int statusCode)

JsonDateEncoding

Requirements

Namespace: Westwind.Web
Assembly: westwind.web.dll

© West Wind Technologies, 1996-2016 • Updated: 12/12/15
Comment or report problem with topic