Consuming a Dynamics 365 for Operations JSON service
In this recipe, we will extend the previous C# project to consume the service using JSON.
The primary difference is that JSON will not create the contract and client classes for us, we will need to write them. We will use a NuGet package to help with the serialization and deserialization of C# classes to JSON.
Getting ready
We are continuing the previous recipe, which must be completed and built before we continue.
How to do it...
To consume a Dynamics 365 for Operations service using JSON, follow these steps:
- First, let's take a look at what JSON looks like; this will help the recipe make more sense as we progress. Open the following URL using Internet Explorer:
https://usnconeboxax1aos.cloud.onebox.dynamics.com/api/services/
- This will ask you to open
services.json
; click onOpen
, which opens a file in Visual Studio that contains all the services exposed. The file will contain our service in the following format:
{"ServiceGroups":[{"Name":"ConWHSServices...