Iron Speed Designer Help
 

Implementation Details

Once the application is generated you will see additional folders and files specific to the RESTful application.

These folders and files are described in the following sections.

App_Start

This folder includes the WebAPIConfig.cs(vb) file. This file registers handlers, different route patterns and other configuration settings required by the RESTful API:

Setting

Description

Config.Routes.MapHttpRout (RoutesPattern)

Calls proper method such as PostGetList, PostGetCount, etc. based on the incoming request’s URL form.

Config.EnableCors()

Registers the Cross Origin Request  (CORS) library which allows to accept requests from different domains.

Config.MessageHandler (Handler):

Registers custom handler to check for incoming request authentication. For example APIKeyHandler is registered to provide Private/Public keys authentication while RequireHTTPS handler is registered to enforce HTTPS protocol.

According to best practices it is recommended that your application use HTTPS protocol.

Filters

Filters can be added to specific methods, for example RequireHTTPS filter enforce HTTPS protocol for the specific method.

Handlers

Handlers are similar to Filters, but it puts restriction on the whole application.

Controllers

Iron Speed Designer generates a controller class for each table plus a CommonRestful class for third party applications. These classes implement methods to handle incoming requests.

Web.config settings

There are 6 different keys inside this file which play a vital role for the RESTful application to work correctly.

Key

Description

RestfulEnabled

Enables RESTful API.

RestfulHost

Specifies the URL of the Restful API provider and is used for constructing request URI.

Note: It is set by Deployment Wizard and empty before Deployment Wizard is run.

RestfulEnforcePublicPrivateKey

Enables  Public and Private Key authentication.

RestfulEnforceEncryption

Enables payload encryption using Crypto class.

RestfulPublicKey and RestfulPrivateKey

These keys are generated out of the box using 32 bit Cryptography. These are used by out of the box consumer and provider application, changing these key values could result in unauthorized request.

They are set by the Application Wizard and Deployment Wizard.

Bin Directory

Following are the DLLs copied for the RESTful application:

Newtonsoft.Json.dll

System.Net.Http.dll

System.Net.Http.Formatting.dll

System.Web.Cors.dll

System.Web.Http.Cors.dll

System.Web.Http.dll

System.Web.Http.WebHost.dll