+ Start a Discussion
GaneeeshGaneeesh 

Difference between SOAP API and REST API..?

Can any body help me what are the differences between SOAP API and REST API..?

MandadiMandadi

 Hi Ganeesh,

            The following are the differences between SOAP and REST API.

SOAP has been preferred for services within the enterprise and
REST has been preferred for services that are exposed as public APIs.

 

And also Compare to SOAP , the advantage of REST API lies with performance: with better cache support, lightweight requests and responses, and easier response parsing, REST allows for nimbler clients and servers, and reduces network traffic, too.

Satish_SFDCSatish_SFDC
You access rest API in the form of URL's. Normal URL's which you type in your address bar.

SOAP API on the other hand involves downloading a WSDL file, Converting the WSDL files to regular classes and then invoking methods on those objects.

REST or SOAP depends on your exact requirements.

Regards,
Satish Kumar
Please mark my answer as a solution if it was helpful so it is available to others as a proper solution.
If you felt I went above and beyond, please give me Kudos by clicking on the star icon.

Groundwire ConsultingGroundwire Consulting

Hi ,

 

A)SOAP API and REST API are two commonly used API's to expose your data from force.com platform to the other platforms(JAVA , .NET ,etc) or to allow external application to invoke Apex methods.

 What is SOAP ?

The Simple Object Access Protocol (SOAP) is an attempt to define a standard for creating web service APIs. It is a pattern, a web service architecture, which specifies the basic rules to be considered while designing web service platforms. It typically uses HTTP as a layer 7 protocol, although this is not mandatory. The SOAP message itself consists of an envelope, inside of which are the SOAP headers and body, the actual information we want to send. It is based on the standard XML format, designed especially to transport and store structured data. SOAP may also refer to the format of the XML that the envelope uses.

SOAP is a mature standard and is heavily used in many systems, but it does not use many of the functionality build in HTTP. While some consider it slow, it provides a heavy set of functionality which is a necessity in many cases. It might now be the best solution for browser-based clients, due to its custom format.

 What is REST ?

The Representational State Transfer (REST) is another architectural pattern (resource-oriented), an alternative to SOAP. Unlike SOAP, RESTful applications use the HTTP build-in headers (with a variety of media-types) to carry meta information and use the GET, POST, PUT and DELETE verbs to perform CRUD operations. REST is resource-oriented and uses clean URLs (or RESTful URLs).

For example :

http://www.developingthefuture.com/index.php?page=foo

becomes

http://www.developingthefuture.com/foo

This kind of URLs syntax greatly improves both visibility and usability. It doesn’t use any query strings, and it also provides certain SEO benefits (the crawlers just love plain text). The body of the REST message can be XML, JSON or any other format, although JSON is usually the preferred choice. On the other hand, you can’t use JSON with SOAP. Or at least not entirely, because SOAP uses XML by definition for it’s envelope. It should also mentioned that REST is, by design, protocol-agnostic, although it is usually used with HTTP. 

 

SOAP API

1)Supports data in the form of XML only 2)Requires WSDL for the integration 3)Use SOAP API in any language that supports Web services.

REST API

1)Supports both XML and JSON format 2)Preferred for mobile and web apps since JSON being Lighter the app runs smoother and faster

 

and if you have any more questions please feel to contact me on support@groundwireconsulting.com

Abraham kumarAbraham kumar
Hi All,

i have a particular requirement in which the contact data from salesforce has to be sent to a web application in JSON format, This has to be triggered when the contact email is changed in salesforce. please can anyone suggest how this can be done using Rest api to send data in json format. I am new in integration, Please help

Many Thanks!!
Abraham
DebadyutiDebadyuti
When to Use REST API
REST API provides a powerful, convenient, and simple REST-based web services interface for interacting with Salesforce. Its advantages include ease of integration and development, and it’s an excellent choice of technology for use with mobile applications and web projects. However, if you have many records to process, consider using Bulk API, which is based on REST principles and optimized for large sets of data.

When to Use SOAP 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.
For example, you can use SOAP API to integrate Salesforce with your org’s ERP and finance systems. You can also deliver real-time sales and support information to company portals and populate critical business systems with customer information.

Reference : https://help.salesforce.com/articleView?id=integrate_what_is_api.htm&type=5
 
Akshay_DhimanAkshay_Dhiman
Hi Ganeeesh,

SOAP API and REST API are two commonly used API's to expose your data from force.com platform to other platforms(JAVA, .NET, etc) or to allow external application to invoke Apex methods.

http://blogs.developerforce.com/tech-pubs/2011/10/salesforce-APIs-what-they-are-when-to-use-them.html

This is an interesting blog and may answer your question very well.

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_quickstart_intro.htm

API described in Salesforce documentation above.

SOAP API

1)Supports data in the form of XML only 2)Requires WSDL for the integration 3)Use SOAP API in any language that supports Web services.

REST API

1)Supports both XML and JSON format 2)Preferred for mobile and web apps since JSON being Lighter the app runs smoother and faster

You can also use Apex SOAP and REST Web services to expose data from the platform or allow an external application to invoke Apex methods.

You may want to refer to the Apex guide to learn more about this.

Please mark as best answer if it helps you.

Thank You 
Ankit Jain 2909Ankit Jain 2909
REST API
  1. REST has been preferred for services that are exposed as public APIs.
  2. Supports both XML and JSON format.
  3. Preferred for mobile and web apps since JSON being Lighter the app runs smoother and faster.
  4. REST API has no has no official standard at all because it is an architectural style.
  5. The ways both APIs exposes the business logics are also different. REST API takes advantage of URL exposure like @path("/WeatherService").
  6. REST API uses Web Application Description Language.
SOAP API
  1. SOAP has been preferred for services within the enterprise
  2. Supports data in the form of XML only and requires WSDL for the integration.
  3. Use SOAP API in any language that supports Web services.
  4. SOAP API has an official standard because it is a protocol.
  5. SOAP API used of services interfaces like @WebService.
  6. SOAP API used Web Services Description language for describing the functionalities being offered by web services.
Ajay K DubediAjay K Dubedi
Hi Ganeeesh,
 
The following are the differences between SOAP and REST API:
1.REST API has no has no official standard at all because it is an architectural style. SOAP API, on the other      hand,has an official standard because it is a protocol.
2.REST APIs uses multiple standards like HTTP, JSON, URL, and XML while SOAP APIs is largely based on HTTP and XML.
3.As REST API deploys multiple standards, so it takes fewer resources and bandwidth as compared to SOAP that uses XML for the creation of Payload and results in the large sized file.
4.The ways both APIs exposes the business logics are also different. REST API takes advantage of URL exposure like @path("/WeatherService") while SOAP API use of services interfaces like @WebService.
5.SOAP API defines too many standards, and its implementer implements the things in a standard way only. In the case of miscommunication from service, the result will be the error. REST API, on the other hand, don't make emphasis on too many standards and results in corrupt API in the end.
6.REST API uses Web Application Description Language, and SOAP API used Web Services Description language for describing the functionalities being offered by web services.
7.REST APIs are more convenient with JavaScript and can be implemented easily as well. SOAP APIs are also convenient with JavaScript but don't support for greater implementation.

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi