1

Hello I was preparing for certification and was confused about the difference in HTTP callout and REST &SOAP api. Can anyone please explain what the key differences in these.

Thank you in advance.

5

An HTTP callout is code that you write within Salesforce to (generally) call out to an external API over HTTP.

REST and SOAP are types of APIs.

So, you could make a callout to an external SOAP API or a REST API. Think of doing a callout as wanting to communicate with someone, the protocol (REST or SOAP) is the format of the communication, and HTTP is the method of communicating. If you mix them up it doesn't work, like trying to send a fax to someone's cell phone number. In that example, the phone line is the method (HTTP), the fax is the protocol(SOAP or REST) and making the call is the callout.

Salesforce also has it's own SOAP and REST APIs, but those would generally be used by code ran outside of Salesforce to create/read/update/delete Salesforce data.

  • Nailed it. Inbound vs. outbound. – Adrian Larson Aug 25 '16 at 17:55
  • Thank you Ryan. Your examples gave me a really good idea. – Vishal Aug 25 '16 at 20:01
  • Good answer! One thing: Shouldn't be HTTP the protocol and REST & SOAP the method ? :) – rpax Aug 26 '16 at 20:20
  • @rpax Yeah, I got a little tripped up there. HTTP and REST/SOAP are both protocols (the P in HTTP and SOAP both stand for protocol) but for different things. I had to call one of them something else to avoid confusion. I was trying to not cause more confusion by getting in to why they were both protocols but still different things. – Ryan Elkins Aug 31 '16 at 18:38
  • @RyanElkins You are right. Avoids confusions and goes right to the point. – rpax Sep 1 '16 at 7:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.