Required IIS Configuration
This section describes some important configuration changes that need to be applied when using Internet Information Services (IIS) as the front-end web server for the Open Data API.
Supporting + in Schema Endpoint URLs
Where there are spaces in the ID of an element within the data catalogue, the Open Data API /schema endpoint represents the space using a + character.
For example, the following excerpt from a dataset schema response shows a field group with a space in the name, and the corresponding endpoint URL for querying that group has + in place of the spaces:
{
"id": "str:group:UKRoadSafetyData:X_Vehicle+Make+and+Model",
"label": "Vehicle Make and Model",
"location": "https://sw2.wingarc.com.au/webapi/rest/v1/schema/str:group:UKRoadSafetyData:X_Vehicle+Make+and+Model",
"type": "GROUP"
}
IIS versions 7 and onwards do not automatically convert the + back to a space by default. This means that if a user or application attempts to query the location endpoint it received from the API, IIS will return a 404 (Not Found) HTTP response.
One way to resolve this is to set allowDoubleEscaping to true in the IIS application web.config file.
Supporting : in Schema Endpoint URLs
The Open Data API uses the : character as a separator when representing items in the schema. For example, datasets are represented using an ID in the format:
str:database:<dataset_id>
Where <dataset_id> is replaced by the ID configured for that dataset in SuperADMIN. For example:
{
"id": "str:database:bank",
"label": "Retail Banking (Sample)",
"location": "https://sw2.wingarc.com.au/webapi/rest/v1/schema/str:database:bank",
"type": "DATABASE",
"lastModified": 1629864501084,
"recordViewEnabled": true
},
API users need to be able to query these lower-level endpoints containing the : character (such as https://sw2.wingarc.com.au/webapi/rest/v1/schema/str:database:bank in this example). However, IIS does not support the : character in URLs by default, and queries to these endpoints will return a 400 (Bad Request) HTTP response.
You can resolve this by adding a rule similar to the following to the IIS application web.config file:
<system.web>
<httpRuntime requestValidationMode="2.0" requestPathInvalidCharacters="<,>,*,%,&,\,?" />
</system.web>
Hostname in Schema Responses
To ensure that the Open Data API reports the correct hostname in responses to requests to the /schema endpoint, you must ensure that preserveHostHeader is set to true in the IIS Application Request Routing module for the reverse proxy to Tomcat.