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, Enterprise edition's OData services.

OData services can be consumed by 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 for the .NET library to build a client application using the C# programming language, and consume Finance and Operations OData services. The following figure describes high-level steps that a developer needs to go through to consume OData service endpoints:

As shown, consuming OData endpoints can be explained by three activities. Let's try to explore this as we go further.

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

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