Salesforce Integration/Apex Integration

Salesforce Integration/Apex Integration Introduction

Apex Callout: A callout makes a call to external web service or sends HTTP request to from Apex Code, and then receives the response.

An Apex callout helps you to integrate Apex code with an external web service.

Below are the two types Apex Callouts: 

SOAP: Web service callout to SOAP web service use XML. This require a WSDL document for code generation.

REST: HTTP callouts to services typically use REST with JSON.

Both SOAP & REST callouts are similar in terms of sending a request to a service and receiving a response. WSDL-based callouts apply to SOAP Web services, HTTP callouts can be used with any HTTP service, either SOAP or REST.

Remote site administration and security: Register you external site in salesforce remote site settings before callout can call external site, otherwise callouts will fail. Salesforce prevents calls to unauthorized network addresses.

How to add remote site setting?

To add remote site setting go to setup -> remote site setting Click New remote Site Setting enter remote site setting name and URL click on save.

Salesforce Integration

Remote Site Setting 1