Thursday, April 20, 2023

#965 OIC 23.04 New Features - OData Adapter














According to odata.org - OData is the best way to do REST. In this simple example, I will show you how to use the newly released OIC OData adapter to retrieve customers from a public OData service. I am using the following https://services.odata.org/V2/Northwind/Northwind.svc/.














Step 1 is to create the OData connection in OIC - 



I add the service base url and, as this service is public, I set the security policy to No Security Policy.

Test & Save.

Now to the integration - 














I set the trigger response as follows - 

{
  "Customers" : [ {
    "CustomerID" : "ERNSH",
    "CompanyName" : "Ernst Handel",
    "ContactName" : "Roland Mendel",
    "ContactTitle" : "Sales Manager",
    "Address" : "Kirchgasse 6",
    "City" : "Graz",
    "Region" : null,
    "PostalCode" : "8010",
    "Country" : "Austria",
    "Phone" : "7675-3425",
    "Fax" : "7675-3426"
  }, {
    "CustomerID" : "ERNSH",
    "CompanyName" : "Ernst Handel",
    "ContactName" : "Roland Mendel",
    "ContactTitle" : "Sales Manager",
    "Address" : "Kirchgasse 6",
    "City" : "Graz",
    "Region" : null,
    "PostalCode" : "8010",
    "Country" : "Austria",
    "Phone" : "7675-3425",
    "Fax" : "7675-3426"
  } ]
}

Essentially, a simple list of customers.

Now to the OData Invoke configuration - 






Last step is the Response Mapping - 

very easy, since I used the same fields names as in the source - 














Activate & Test - 








No comments: