Skip to content

API Test Configuration

Robert Polak edited this page Aug 27, 2019 · 19 revisions

Home / API Test / Configuration

1. Solution Server API Library reference

The Server API Library Solution need to be compile and use as reference at The API.Test Solution

API.Library reference files:

  • API.Library.dll
  • API.Library.dll.config
  • API.Library.pdb

The Server API Library files are located at folder \src\API.Library\bin\Release

Screen shot The API.Test Solution reference to API.Library

image

2. Solution web.config - Configuration

Each Deployment environment have specific test\API.Test\Web.config file:

  • test\API.Test\Web.config - Development environment (Debug)
  • test\API.Test\Web.Live.config - Production environment (Live)
  • test\API.Test\Web.Test.config - Test environment (Test)
  • test\API.Test\Web.UATconfig - UAT environment (UAT)

test\API.Test\Web.config entries listed as below:

  • IIS - Compilation & Worker limit

<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.7.2" />
    <!-- executionTimeout (Seconds), maxRequestLength (KB) = APP_PX_MAX_SIZE_BYTE + 1MB  -->
    <httpRuntime executionTimeout="3600" maxRequestLength="11264" targetFramework="4.7.2" />
  </system.web>
  ...
</configuration>
  • IIS - Request limit and handlers

<configuration>
  ...
  <system.webServer>

  <security>
      <requestFiltering>
        <!-- maxAllowedContentLength (B) APP_PX_MAX_SIZE_BYTE + 1MB -->
        <requestLimits maxAllowedContentLength="11534336" />
      </requestFiltering>
    </security>

    <handlers>
      <!-- Add the handler to instruct IIS to serve the JSON RPC webservice requests -->
      <add verb="POST,GET" path="api.jsonrpc" name="API" type="API.JSONRPC" />
    </handlers>
  ...
  </system.webServer>
  ...
</configuration>
  • CORS - Cross-Origin Resource Sharing

<configuration>
  ...
  <system.webServer>
  <httpProtocol>
      <customHeaders>
        <!-- Local CORS -->
        <add name="Access-Control-Allow-Origin" value="http://localhost" />
        <add name="Access-Control-Allow-Headers" value="Origin, X-Requested-With, Content-Type, Accept" />
        <add name="Access-Control-Allow-Credentials" value="true" />
      </customHeaders>
    </httpProtocol>

    <rewrite>
      <outboundRules>
        <!-- Private CORS - Default -->
        <rule name="Access-Control-Allow-Origin" enabled="true" patternSyntax="Wildcard">
          <match serverVariable="RESPONSE_Access-Control-Allow-Origin" pattern="*" />
          <conditions trackAllCaptures="false"></conditions>
          <action type="Rewrite" value="{HTTP_ORIGIN}" />
        </rule>
        <!-- Private CORS - DNS filter -->
        <!--
				<rule name="WWW-Authenticate" enabled="true" patternSyntax="Wildcard">
					<match serverVariable="RESPONSE_WWW-Authenticate" pattern="*" />
					<conditions>
						<add input="{HTTP_ORIGIN}" pattern="https://domain.extension" negate="true" />
					</conditions>
					<action type="Rewrite" value="Anonymous" />
				</rule>
				-->
        <!-- Private CORS - IP filter -->
        <!--
				<rule name="WWW-Authenticate" enabled="true" patternSyntax="Wildcard">
					<match serverVariable="RESPONSE_WWW-Authenticate" pattern="*" />
					<conditions>
						<add input="{REMOTE_ADDR}" pattern="x.y.z.j" negate="true" />
					</conditions>
					<action type="Rewrite" value="Anonymous" />
				</rule>
				-->
      </outboundRules>
    </rewrite>
  </system.webServer>
  ...
</configuration>
  • Additional # API Test Configuration

Details about Configuration listed below at API Library Configuration at Configuration

* API - JSONRPC
* API - Active Directory
* API - ReCAPTCHA
* API - eMail
* API - ADO
* API - MemCacheD
* DB - Connection Strings 
* CACHE - MemCacheD - `enyim`
* LOGGING - Log4Net 
* etc...

More details about the Server API Test at Server API Test.

Clone this wiki locally