#Web API Processing Architechture

Over View :

In this article we will discuss the behavior of  web api when a request is made(Request) and an output it produces(Response).

Architecture :

The web API processing architecture can be divided into three Layers.

1.Hosting Layer.

2.Message Handler Pipeline Layer.

3.Controller Handler Layer.

Hosting Layer :

This layer that is responsible for exposing the web API to outside world.The Hosting layer takes care of bridging the web API and HTTP infrastructure(HTTP Listener).

Responsibilities :

1.It is also responsible for  creating HTTPRequestMessgae when HTTP Request is made and then pushing the request to next layer(Message Handler)

2.It is also responsible for converting the HTTPResponseMessage received from the Message Handler and then sending it as HTTP Response Message.


Mesaage Handler Layer:

A Message Handler acts a middle layer that performs operation over HTTPRequestMessage and HTTPResponseMessage.

For instance,when a response header  is sent from the server,you would find a attribute named “Server” which contains the server name where the request was processed. All these kind of operation are done over this layer.

There are two important  handlers in Message Handler :

1.Route Dispatcher.

2.Controller Dispatcher.

Route Dispatcher :

This is essentially where we declare the routes of web API.(Routeconfig in MVC/WEB API).

Responsibilities :

  1. When a route is made and if it has the matching route defined in Route Config ,then the Route Dispatcher forwards it to the Controller Dispatcher.
  2. If there are no match in Route,Return 404.

Controller Dispatcher :

The Controller Dispatcher is responsible for calling the respective controllers in Web API. This Dispatcher acts as a bridge between Message Handler and Controller Handler. 

ControllerHandler :

The last and final layer where we write the concrete business logic methods.This layer includes functionalities like


2.Expection Filters.

3.Action Filters.

4.Model Binding.

Over All Architecture of WEB  API :






Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s