2

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.

1 Answer 1

6

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.

6
  • Nailed it. Inbound vs. outbound.
    – Adrian Larson
    Commented Aug 25, 2016 at 17:55
  • Thank you Ryan. Your examples gave me a really good idea.
    – Vishal
    Commented Aug 25, 2016 at 20:01
  • 1
    Good answer! One thing: Shouldn't be HTTP the protocol and REST & SOAP the method ? :)
    – rpax
    Commented Aug 26, 2016 at 20:20
  • 1
    @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. Commented Aug 31, 2016 at 18:38
  • @RyanElkins You are right. Avoids confusions and goes right to the point.
    – rpax
    Commented Sep 1, 2016 at 7:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .