8

RPC protocol uses TCP as an underlying protocol and HTTP again uses TCP as an underlying protocol. So why is HTTP is widely accepted?

Why does SOAP use HTTP as an underlying protocol - why not RPC?

Arpit Aggarwal
  • 27,626
  • 16
  • 90
  • 108
Programmer
  • 713
  • 1
  • 8
  • 23

2 Answers2

6

Remote Procedure Calls (RPC) is not a protocol, it's a principle that is also used in SOAP.

SOAP is an application protocol that uses HTTP for transport (so it won't have to think about encoding, message boundaries and so on). One of the reasons to use SOAP over HTTP is that for HTTP you usually don't need firewall rules and that the HTTP infrastructure is mature and commonly rolled out.

CodeCaster
  • 147,647
  • 23
  • 218
  • 272
  • RPC is indeed referred to as request-response protocol. – tcurdt Nov 16 '22 at 03:37
  • By whom? Wikipedia? They get things wrong, you know. There is no single RPC protocol; RPC describes the principle of executing a procedure (code, function) in another process (remote, not necessarily on another computer). How to do so is up to the developer. – CodeCaster Nov 16 '22 at 07:43
  • I didn't say there is a single RPC protocol. But that "principle" is usually still being referred to as a request-response protocol. ‍♂️ If you don't trust Wikipedia just Google for all the references. Not sure which you find credible enough. Whatever is the truth, it makes the first sentence a little more debatable as you make it sound. Do you have a source for backing your PoV? – tcurdt Nov 16 '22 at 12:18
  • A protocol prescribes _rules_, RPC describes a principle. JSON-RPC is a protocol, RPC itself is not. Please show me one credible source and I'll consider updating my answer. – CodeCaster Nov 16 '22 at 12:20
  • 1
    I wouldn't know which sources you deem credible - so that's a bit pointless. Maybe this discussion here is enough for people taking the first sentence with a grain of salt. – tcurdt Nov 17 '22 at 12:40
5

RPC does not require HTTP. Basically, RPC describes any mechanism that is suitable to invoke some piece of code remotely. The transport mechanism used to perform the RPC could be SOAP over HTTP. It could also be a REST call returning some JSON data over HTTP.

SOAP can also be used via Mails, and AFAIK (not sure here) the BizTalk Server should support this scenario. But even something exotical like trying SOAP over Avian Carriers can also be considered an RPC, although the latency of the latter may not be sufficient for real-world applications.

Think of an RPC as sending somehow some kind of message to a destination, in order to initiate a specific action and (optionally) getting some information back after the action has been completed. What prticular technology you choose to transmit these messages does not really matter.

JensG
  • 13,148
  • 4
  • 45
  • 55