Difference between Web API, Organization service and Organization Data service in Microsoft Dynamics CRM
Web API is introduced with Microsoft Dynamics CRM 2016 and will provide parity with the Organization service.
Key points about Web API:
- Web API provides parity with Organization service with some limitations.
- It implements OData (Open Data Protocol) version 4.0 which is an open standard for building and consuming RESTful APIs over rich data sources like DOC, HTML and PDF.
- Because Web API is built on open standards therefore it’s no necessary to use Microsoft Dynamics CRM provided libraries, third-party libraries can be used to generate classes.
- You can compose own Http requests as well.
- Web API will gradually replace Organization service and Organization Data service to become single web service for Microsoft Dynamics CRM.
- Authentication is provided by the application itself when used within web resources, form scripts and ribbon commands.
- Maximum 5000 records can be return for each request.
Organization service is available since Microsoft Dynamics CRM 2011 and is mainly used for server side development i.e. code running on Microsoft Dynamics CRM server.
Key points about Organization service:
- Implements IOrganizationService interface.
- Organization service is also known as SOAP endpoint.
- Microsoft Dynamics CRM uses Windows Communication Foundation (WCF) to SOAP endpoint.
- It is the primary web service for accessing data and metadata from Microsoft Dynamics CRM organization.
- It is built on WCF and optimized for use with the .Net.
- Organization service request and response has SOAP format.
- Microsoft Dynamics CRM SDK provides assemblies and tools to generate strongly typed classes and proxies to simplify development in Microsoft Visual Studio.
- Maximum 5000 records can be returned in a single query.
Organization Data Service
Key points about Organization Data service:
- It is preferred service for client-side development.
- Organization Data service is also known as “OData” or “REST” endpoint.
- Microsoft Dynamics CRM uses Windows Communication Foundation (WCF) to provide REST-based service.
- It supports JSON and ATOM format.
- Organization Data service can be used within Web resources, form scripts and ribbon commands.
- Authentication is provided by the application itself, no need to write authentication code.
- It implements OData v2 standard.
- It is deprecated with Microsoft Dynamics CRM 2016, Web API should be used to support Microsoft Dynamics CRM 2016 and future versions.
- It can return maximum 50 records in a single retrieve operation.
It is much faster as compared to Organization service, because less bytes in JSON message in comparison to SOAP message