Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.

com Nov-2022 Pg 1 of 16


API Protocols

Based on the requirements, APIs can be used in various forms and


styles. The chosen API style (REST, SOAP, Websocket or Webhooks)
decides how API security should be applied and implemented. Before
web APIs came into being, the key API style uses were SOAP Web
Services. In the era of service-oriented architecture WS from
2000-2010, XML was used widely.

Time line of creation

APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 1 of 16
APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 2 of 16

API Protocol Comparison


Table: Protocol Overview

Proto Format Organized in terms of Use cases


col

SOAP XML only enveloped message - Large enterprise


structure environments
- CRM solution
- Payment gateway
- Identity management
- Healthcare, financial and
telecommunication
services
- Legacy system support

XML- XML, HTTP human-readable-and-writa - Linking computers


RPC ble, script-parsable - Connecting different
standard for HTTP-based types of environments
requests and responses
- Creating open software
interfaces

REST JSON, XML, with six architectural - Public API


HTML, plain constraints - Simple resource-driven
text apps

JSON- JSON sending multiple calls to - Fast and reliable


RPC the server information exchange
- Used on Ethereum

APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 2 of 16
APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 3 of 16

What are types of API protocols?

These API protocols facilitate standardized information exchange:

1. XML-RPC is a protocol that relies on a specific format of XML to


transfer data, whereas SOAP uses a proprietary XML format.
XML-RPC is older than SOAP, but much simpler, and relatively
lightweight in that it uses minimum bandwidth.

2. SOAP (Simple Object Access Protocol) is an API protocol built


with XML, enabling users to send and receive data through SMTP
and HTTP. With SOAP APIs, it is easier to share information between
apps or software components that are running in different
environments or written in different languages.

APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 3 of 16
APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 4 of 16

APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 4 of 16
APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 5 of 16

APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 5 of 16
APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 6 of 16

APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 6 of 16
APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 7 of 16

APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 7 of 16
APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 8 of 16

When To Use SOAP?


As SOAP plays a key role in API development, here are the areas where its
implementation will be proved fruitful.
1. Use it for synchronous processing and invocation subsequently
If the client needs to have certain application reliability and enhance API
security then the latest SOAP standard, SOAP 1.2, is here to here. It offers
a couple of professional features for seamless and synchronous
processing.
It also supports subsequent invocation of certain APIs and incorporates
needed security practices.
2. Use it as an official communication
In situations when server and client are already ready to exchange data in
a format then use SOAP 1.2 as it offers a wide range of rigid specifications
for such a communication.
3. Use it for seamless processing of stateful operations

APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 8 of 16
APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 9 of 16

For an application that has an obligation to maintain the state from one
request to another, using SOAP 1.2 will make the job quick and easy as it
endows the developers with a recognized WS* structure for such tasks.

3. REST

REST or Representational State Transfer is an undividedly different


approach. It’s a type of architectural pattern employed widely for the
modern web-based application development task. It administers the key
application components like files, even objects, and media components.
APIs, produced using REST, is ready to present website or application
functionality over the HTTP and are supportive with HTTP verbs like getting
and POST

As REST APIs have unmatched interoperability on the web, they have


become the prime choice of many.

APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 9 of 16
APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 10 of 16

APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 10 of 16
APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 11 of 16

Basic features of REST


● REST takes the help of Uniform Service locators to reach at the heart
of the hardware device components.
● REST is the base for data communication, which happened in the
modern application infrastructure.
● While SOAP can’t use REST, REST can use SOAP. It uses it as a
key protocol of web services describing the tool. In fact, it will need
SOAP for completing the application development as it’s only an
architectural pattern and doesn’t have any standard format for
explaining web services.

When to use REST?


If one wants to utilize the full potential of REST, using it in the right place is
the key. Here are the key areas wherein it can do wonders.

1. Use it when you have restricted bandwidth


2. Use it when there is no need to maintain a state
Operations that involve no adherence with the statelessness in transferring
information from one request to another can be done with full accuracy with
REST.
3. Use it when catching a lot of requests is the need of the hour
Caching of requests is a key operation and needs to be accomplished with
full accuracy. With REST, it’s easy to catch the information as it supports it
by all means. In fact, it has handled catching information of the same
request multiple times. By doing so, it cuts down the time invested in
application development.
4. Use it when easy coding is required
The coding of REST APIs and services is far more seamless than SOAP. If
there is a time crunch and a quick yet effective web application service is
required then REST is the right choice to make.

APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 11 of 16
APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 12 of 16

Example REST API


An example REST API object is shown here:
{
"name": "XYZ",
"location": "India",
"title": “developer”,
joinYear: 2010
}

APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 12 of 16
APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 13 of 16

APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 13 of 16
APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 14 of 16

APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 14 of 16
APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 15 of 16

4. JSON-RPC

Compared to REST and SOAP, JSON-RPC is relatively narrow in scope.


It supports a small set of commands, and does not offer as much
flexibility as a protocol like REST with regard to exactly how one
implements it.

However, if you like simplicity and have a straightforward use case that falls
with JSON-RPC’s scope, it can be a better solution than REST.

What is JSON-RPC?
Many decentralized platforms use JSON-RPC APIs, such as Bitcoin,
Ethereum, Ripple, Solana and others. To truly understand what JSON-RPC
is, we have to first explore what JSON is and then separately, look at what
RPC means.
What is JSON?
JSON is the lightweight data-interchange format and it means JavaScript
Object Notation. JSON is not a programming language in its own right but
is based on a subset of the JavaScript Programming Language Standard.
JSON uses conventions that resemble the C-family of languages (C, C++,
C#, Java, JavaScript, Perl, Python and others) to structure data so that it is
easy to transfer.
Its text-based format is easy for humans to read and write and easy for
machines to parse and generate, making it an ideal data-interchange
language.
What Does RPC Mean?
RPC stands for remote procedure call. RPC is a broad term used to
describe a variety of API approaches and has been in use since the 1970s,
extending beyond web applications.
In distributed computing, an RPC is a communication protocol in which one
computer program executes a procedure (subroutine) in a different address
space such as another computer on a shared network.
RPCs are the same whether they are local or remote. That is, the
programmer will essentially write the same code with no need to explicitly
distinguish whether the subroutine is local to the executing program, or
remote.

APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 15 of 16
APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 16 of 16

How Does Remote Procedure Call (RPC) Work?


RPC uses a client-server model. A remote procedure call is initiated or
requested by the client and the service-providing side is the server. Just as
in a local procedure call, the requesting program is suspended until the
results of the request are returned.
When a client sends a request, it transfers the procedure parameters
across the network to the server’s environment where the procedure is
executed.
Then, when the procedure is complete, the server transfers the results
back to the client, where the program resumes just like it would have had
the details been returned from a local procedure call.
Back to the question then, what is JSON-RPC?

JSON-RPC Explained
JSON-RPC is a succession of JSON and keeps the simplicity of the original
protocol, by defining no more than a few data types and commands.
It enables the sending of notifications to the server; the notifications are
data that doesn’t require a response from the server. It also allows for
multiple calls which can be answered out of sequence. It also brings into
play an assorted data structure defining tasks for applications.
JSON-RPC has a light construction which allows for quick processing
which makes it ideal for transferring data to blockchain nodes.
It is also a transport-agnostic protocol, meaning that it can interact over
different transmission channels such as HTTP/S, WebSockets, XMPP,
telnet, SFTP, SCP, or SSH, and all within the same process.

APIs in Cloud Computing SOAP REST JSON XML-RPC compiled src7cse@gmail.com Nov-2022 Pg 16 of 16

You might also like