Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Salesforce SOAP vs REST

I have been building a console app the uses the Saleforce SOAP API, and now need to use the Salesforce API in a web app.

Am I correct to assume that SOAP is better suited for a non web-based app, and REST is better for a web app?

If I where to create a wrapper that would be used in either reporting from local apps, or posting to salesforce from our websites, should I expose both the REST and SOAP api's, depending on what the app is? Or should I just stick to using one? What are deciding factors I should look at if I just need to pick one?

like image 676
RJP Avatar asked Apr 11 '12 20:04

RJP


People also ask

What is the difference between SOAP and REST in Salesforce?

Differences Between SOAP And REST are listed below. To expose resources, REST employs (usually) URIs and methods like (GET, PUT, POST, and DELETE). SOAP uses interfaces and named operations to expose business logic.

Does Salesforce use SOAP or REST API?

SOAP API provides a powerful, convenient, and simple SOAP-based web services interface for interacting with Salesforce. You can use SOAP API to create, retrieve, update, or delete records. You can also use SOAP API to perform searches and much more. Use SOAP API in any language that supports web services.

What is the difference between SOAP vs REST?

While SOAP and REST share similarities over the HTTP protocol, SOAP is a more rigid set of messaging patterns than REST. The rules in SOAP are important because we can't achieve any level of standardization without them. REST as an architecture style does not require processing and is naturally more flexible.

Which is better SOAP vs REST?

REST is a better choice for simple, CRUD-oriented services, because of the way REST repurposes HTTP methods (GET, POST, PUT, and DELETE). It is also popular because it's lightweight and has a smaller learning curve. SOAP, on the other hand, has standards for security, addressing, etc.


1 Answers

The other answers contain some good general info, some salesforce specific things to take into account are

1) You can directly bulk update data in the SOAP API, but you'll need to use the Async Bulk API to do that from REST.

2) The soap API contains a few things not available in the REST API, most notably describeLayout, queryAll, getDeleted & getUpdated

3) the REST API contains a few things not available in the SOAP API, including the API for chatter, and access to the recently accessed records lists.

4) the REST API can access binary data (files, attachments, content, etc) without the overhead of base64 encoding/decoding.

So, depending on exactly what your app is trying to do may push you one way or the other.

like image 61
superfell Avatar answered Sep 22 '22 22:09

superfell