All about Service Oriented Architecture : SOAP / REST differences and usage
Service Oriented Architecture
with
REST/SOAP in SFDC
A service-oriented architecture is essentially a collection of services. These services communicate with each other. The communication can involve either simple data passing or it could involve two or more services coordinating some activity. Some means of connecting services to each other is needed.
The technology of Web Services is the most likely connection technology of service-oriented architectures. The following figure illustrates a basic service-oriented architecture. It shows a service consumer at the right sending a service request message to a service provider at the left. The service provider returns a response message to the service consumer.
The request and subsequent response connections are defined in some way that is understandable to both the service consumer and service provider. How those connections are defined is explained in Web Services Explained. A service provider can also be a service consumer.
ref :http://www.service-architecture.com/articles/web-services/service-oriented_architecture_soa_definition.html
Difference between SOAP API and REST API ?
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.
It 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 theGET, POST, PUT and DELETE verbs to perform CRUD operations. REST is resource-oriented and uses clean URLs (or RESTful URLs).
SOAP API
|
REST API
|
Simple Object Access Protocol
|
Representational State Transfer
|
It is based on standard XML format
|
It is based on URI
|
It works with WSDL
|
It works with GET, POST, PUT, DELETE
|
Works over with HTTP, HTTPS, SMTP, XMPP
|
Works over with HTTP and HTTPS
|
Exporting Data From Salesforce REST or SOAP?
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 a large number of records to process, you may wish to useBulk API.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 organization’s ERP and finance systems, deliver real-time sales and support information to company portals, and populate critical business systems with customer information.When to Use Bulk API
Bulk API is based on REST principles and is optimized for loading or deleting large sets of data. You can use it to query, insert, update, upsert, or delete a large number of records asynchronously by submitting batches which are processed in the background by Salesforce. SOAP API, in contrast, is optimized for real-time client applications that update small numbers of records at a time. Although SOAP API can also be used for processing large numbers of records, when the data sets contain hundreds of thousands of records, it becomes less practical. Bulk API is designed to make it simple to process data from a few thousand to millions of records.
API Name Protocol Data Format Communication
REST API REST JSON, XML Synchronous
SOAP API SOAP (WSDL) XML Synchronous
Chatter REST API REST JSON, XML Synchronous (photos are processed asynchronously)
Bulk API REST CSV, JSON, XML Asynchronous
Metadata API SOAP (WSDL) XML Asynchronous
Streaming API Bayeux JSON Asynchronous (stream of data)
Apex REST API REST JSON, XML, Custom Synchronous
Apex SOAP API SOAP (WSDL) XML Synchronous
Tooling API REST or SOAP (WSDL) JSON, XML, Custom Synchronous
API Name | Protocol | Data Format | Communication |
---|---|---|---|
REST API | REST | JSON, XML | Synchronous |
SOAP API | SOAP (WSDL) | XML | Synchronous |
Chatter REST API | REST | JSON, XML | Synchronous (photos are processed asynchronously) |
Bulk API | REST | CSV, JSON, XML | Asynchronous |
Metadata API | SOAP (WSDL) | XML | Asynchronous |
Streaming API | Bayeux | JSON | Asynchronous (stream of data) |
Apex REST API | REST | JSON, XML, Custom | Synchronous |
Apex SOAP API | SOAP (WSDL) | XML | Synchronous |
Tooling API | REST or SOAP (WSDL) | JSON, XML, Custom | Synchronous |
Bulk API
Bulk API is based on REST principles and is optimized for loading or deleting large sets of data. You can use it to query, insert, update, upsert, or delete many records asynchronously by submitting batches. Salesforce processes batches in the background.
Metadata API
Use Metadata API to retrieve, deploy, create, update, or delete customizations for your org. The most common use is to migrate changes from a sandbox or testing org to your production environment. Metadata API is intended for managing customizations and for building tools that can manage the metadata model, not the data itself.
Comments
Post a Comment