Consuming OData services

It's good that you can browse the OData services using a browser and evaluate the response; however, real-life integration is always system to system, running in the background. Let's try to understand how these real-life integrations can be built using Dynamics 365 for Finance and Operations' OData services.

OData services can be consumed by the client application in two ways:

  • Using the pure HTTP communication model, where you build URLs, build request messages, parse and handle responses, and do error handling. Doing all this from scratch can be complicated and unnecessary.
  • Using the already available libraries. There are various libraries and tools available to encapsulate OData HTTP communication in different programming languages.

The following table features many such OData libraries for various development platforms, such as .NET, Java, and JavaScript:

Library Platform Description
OData client for .NET .NET LINQ-enabled client API for issuing OData queries and consuming OData JSON payloads.
Simple.OData.Client .NET A multiplatform OData client library supporting .NET 4.x, Windows Store, Windows Phone 8, Silverlight 5, iOS, and Android.
SDL OData frameworks Java Open source Scala/Java-based SDL OData framework that aligns with the v4 specifications.
Apache Olingo Java Apache Olingo is a Java library that implements the OData.
ODataJS beta JavaScript The Apache Olingo OData Client for JavaScript (ODataJS) is a library written in JavaScript that enables browser-based frontend applications to easily use the OData protocol for communication with application servers.
The OData official website page (http://www.odata.org/libraries/) features many more libraries, including documentation and download links.

Now, let's explore how we can use the OData client to get the .NET library to build a client application using the C# programming language and consume Finance and Operations OData services. The following diagram describes the high-level steps that a developer needs to follow to consume OData service endpoints:

As we can see, consuming OData endpoints is done in three stages. Let's explore these in more detail.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.28.94