Extending Microsoft Dynamics 365 Finance and Supply Chain Management Cookbook - Second Edition
by Simon Buxton
How it works...
The JSON method actually carries less overhead in terms of setting up the calls than SOAP. We don't need to set up any bindings; we just need to set the Authorization header property.
Once we have the authorization, all we need to do is send a string of JSON text to the service, which we could manually create. We use the JSON serialization and deserialize between data contract classes and text for convenience. This is generic JSON, and the code we write is the same as if we were writing for any other application that is able to use this method.
The difficult part is setting up the C# classes that we will deserialize to or serialize from. It isn't obvious at first, especially when a simple list of names, such as ServiceGroups ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access