CommentsFitSolution
Enhanced External Services allows you to invoke an externally
hosted service in a declarative manner (no code required). This
feature is best used when the following conditions are met:
BestEnhanced External Services invokes a REST API
call
•
The externally hosted service is a RESTful service and the
definitions are available in an OpenAPI 2.0 JSON schema
format.
•
The request and response definitions contain primitive
data types such as boolean, datetime, double, integer,
string, or an array of primitive data types. Nested object
types, and send parameters such as headers within the
HTTP requests are supported.
•
The transaction can be invoked from a flow.
Salesforce enables you to consume a WSDL and generate a
resulting proxy Apex class. This class provides the necessary
logic to call the remote service.
Salesforce also enables you to invoke HTTP (REST) services
using standard GET, POST, PUT, and DELETE methods.
Best
Salesforce Lightning—Lightning component
or page initiates a synchronous Apex SOAP or
REST callout.
Salesforce Classic—A custom Visualforce page
or button initiates a synchronous Apex SOAP
callout. A user-initiated action on a Visualforce page or Lightning page
then calls an Apex controller action that then executes this
If the remote endpoint poses a risk of high
latency response (refer to latest limits
proxy Apex class to perform the remote call. Visualforce pages
and Lightning pages require customization of the Salesforce
application.
documentation for the applicable limits here),
then an asynchronous callout, also called a
continuation, is recommended to avoid hitting
synchronous Apex transaction governor limits.
Salesforce enables you to invoke HTTP services using standard
GET, POST, PUT, and DELETE methods. You can use several
BestA custom Visualforce page or button initiates
a synchronous Apex HTTP callout.
HTTP classes to integrate with RESTful services. It’s also possible
to integrate to SOAP-based services by manually constructing
the SOAP message. The latter isn’t recommended because it’s
possible for Salesforce to consume WSDLs to generate proxy
classes.
A user-initiated action on a Visualforce page then calls an Apex
controller action that then executes this proxy Apex class to
perform the remote call. Visualforce pages require
customization of the Salesforce application.
You can use Apex triggers to perform automation based on
record data changes.
An Apex proxy class can be executed as the result of a DML
operation by using an Apex trigger. However, all calls made
SuboptimalA synchronous trigger that’s invoked from
Salesforce data changes performs an
asynchronous Apex SOAP or HTTP callout.
from within the trigger context must execute asynchronously
from the initiating event. Therefore, this solution isn’t
recommended for this integration problem. This solution is
10
Remote Process Invocation—Request and Reply