Configuring OData Activities
When exposing backend data as OData APIs using Cast Iron:
- In this case HTTP Receive Request and HTTP Send Response activities are used to expose OData APIs.
- The output of this HTTP Receive activity (uri, method, host, accept and content-type other http headers, payload) is passed as input to the Read OData activity.
- Steps for configuring Read OData Activity
- Create or open an orchestration. A graphical representation of the orchestration is displayed.
- Select the Activities tab and expand the Transform folder.
- Drag the Read OData Activity onto the orchestration.
- In the checklist, click Configure.
- Select the version for OData version.
- Select Input Data. You can select either one of Existing XML Schema or New XML Schema to support multiple Entities.
- If you have selected Existing XML Schema, click Browse to select the existing XML Schema.
- If you have selected New XML Schema to support multiple Entities, paste the New XML Schema Content and click Generate Maps.
- Select the Map Outputs in the Checklist. The XML Schema generated to hold the response of the activity is displayed as nodes under the readODataOutputPayload parameter in the From Activity panel.
- Populate the map input properties by referring to the Read OData Actiivty.
- Create a map between the output parameters and orchestration variables.
Note:- The output of Read OData Activity is used to perform business logic on the endpoint/backend systems using connectors available in Cast Iron.
- The output from this business logic activities (http response code, payload) and Read OData Actiivty (serviceName, protocol, host, method, accept, content-type, resourcePath, entities, additionalPath, fieldName, primaryKeys and additionalConfiguration) is given as input to the Write OData Activity.
- The value of serviceName in the map input of Read OData Activity must have a same value as that of the value of URL (Path after hostname) property in HTTP Receive Request Activity.
- The format of primaryKeys property in the map input of Read OData Activity is described in Read OData Actiivty.
- Steps for configuring Write OData
Activity
- Create or open an orchestration. A graphical representation of the orchestration is displayed.
- Select the Activities tab and expand the Transform folder.
- Drag the Write OData Activity onto the orchestration.
- In the checklist, click Configure.
- Select the version for OData version.
- Select Input Data. You can select either one of Existing XML Schema or New XML Schema to support multiple Entities.
- If you have selected Existing XML Schema, click Browse to select the existing XML Schema.
- If you have selected New XML Schema to support multiple Entities, paste the New XML Schema Content and click Generate Maps.
- Select the Map Inputs in the Checklist. The XML Schemas generated from the selected object of the Write OData Activity are displayed as nodes under the writeODataInput parameter in the To Activity panel.
- Populate the map input properties by referring to the Write OData Activity.
- Create a map between the output parameters and orchestration variables.
Note: The output of the Write OData activity containing response payload, http status code and headers is passed to the HTTP Send Response actiivity.
Note:
- As of now Cast Iron exposes OData APIs for only DELETE and GET HTTP methods.
- Only the following OData query parameters are supported as of Cast Iron version 7.5.1 ifix005.
- $count - allows clients to request a count of the matching resources included with the resources in the response. Accepts a Boolean value of true or false.
- $skip - requests the number of items in the queried collection that are to be skipped and not included in the result.
- $top - requests the number of items in the queried collection to be included in the result.
- $format - allows clients to request a response in a particular format.
- $select - allows clients to requests a specific set of properties for each entity or complex type.
- $filter - allows clients to filter a collection of resources that are addressed by a request URL. Only 'fieldName eq value' is supported as of 7.5.1 ifix005.
- Business object structures containing simple datatype fields are only supported. Business object structure containing child complex types is not supported.
- OData APIs exposed in Cast Iron 7.5.1 ifix005 supports Salesforce Lightning Connect.