Calling a REST Web Service From an Aras Method

Calling a REST Web Service From an Aras Method

Data federation is something we are asked to implement more and more when we are evaluated for PLM projects. Mainly because of the legacy systems in place, but also because some dedicated software may be very well suited for some specific people in your company.

In our developer training classes, there is a dedicated chapter on federation explaining the different ways of federating data in Aras Innovator. It includes a lab where you actually federate customer data from a SQL database separate from your Aras Install. In the past I think it was also done with an Access database.

Depending on the target you are looking for (MS Access, MS SQL, etc.), the way you will get and update external data will differ. For years, it made sense to directly interact with other databases. But now APIs rule the world of software interactions. Our main API is published using SOAP and will soon be available as a REST service exchanging OData messages.

In the mean time you can already interact with other REST services. Here is an GET request example based on a JIRA integration I recently did for a hackathon.

All the REST call methods can be used, so here is a POST example. I will explain the full JIRA Integration (including, updating, deleting issues, and running lifecycle transitions) in a future article.

In these two methods, I use Json.NET to serialize and parse JSON. You have to download the dll (It might even already be in the Aras install nowadays) and reference it in method-config.xml. Click here to see a blog post about using an external dll.

using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
The JSON I'm pushing to the web service is written inline and I find it quite dirty to do it like this. But I was in a hackathon, so not much time for clean code. It would make more sense to build an actual object and serialize it before sending it.

You should now have the basics to call any REST web service.

Stay tuned for an article about the full integration with JIRA using the REST web service!