Saturday, 7 September 2013

Rest VS SOAP in mscrm 2011

There are two web services you can use to access data by using JavaScript.

REST Endpoint for Web Resources

The current implementation of the REST endpoint is limited to create, retrieve, update and delete operations. The Sample: Create, Retrieve, Update and Delete Using the REST Endpoint with JavaScript includes an SDK.REST.js library that provides an example of a reusable library that can further simplify using the REST endpoint.
One of the advantages of the REST endpoint is that it implements the OData protocol, which provides the way to query and update data. When you use JavaScript, you usually retrieve objects in JavaScript Object Notation (JSON) format. This makes the results easier to work with. The primary limitation of the REST endpoint is that you cannot use the IOrganizationService.Executeetmhod to execute messages (Request and Response classes). You use the SOAP endpoint for web resources to execute messages.
For more information, see Use the REST Endpoint for Web Resources.

SOAP Endpoint for Web Resources

The SOAP endpoint lets you execute messages because the REST endpoint does not yet allow this. You can also call the Create, Retrieve, Update, Delete and RetrieveMultiple methods of this web service, but using it is not as easy as using the REST endpoint.
Microsoft Dynamics CRM does not provide a JavaScript library to facilitate using the SOAP endpoint. When using the SOAP endpoint, you must post http requests that contain the XML defining the request and then parse the XML returned in the response.
The SDK includes an example that shows how to retrieve entity and attribute metadata. For more information, see Sample: Retrieve Entity Metadata Using JavaScript. The SDK.MetaData.js library in that sample can be used when you want to retrieve entity or attribute metadata.For more information, see Use the SOAP Endpoint for Web Resources