How to answer "What is the difference of REST and SOAP" in an interview?

Rusty1
Tera Contributor

Please help. 

5 REPLIES 5

Ct111
Tera Sage

BEst is check the below link

https://community.servicenow.com/community?id=community_question&sys_id=98bdc36ddb9cdbc01dcaf3231f96194f

 

Mark my ANSWER as CORRECT and HELPFUL

Apurva Malewad1
Kilo Guru

Hi Captain D,

You can tell the below points:

REST vs SOAP

 

As you may have noticed the companies I mentioned that are using REST api's haven't been around for very long, and their apis came out this year mostly. So REST is definitely the trendy way to create a web service, if creating web services could ever be trendy (lets face it you use soap to wash, and you rest when your tired). The main advantages of REST web services are:

 

Lightweight - not a lot of extra xml markup Human Readable Results Easy to build - no toolkits required SOAP also has some advantages:

 

Easy to consume - sometimes Rigid - type checking, adheres to a contract Development tools For consuming web services, its sometimes a toss up between which is easier. For instance Google's AdWords web service is really hard to consume (in CF anyways), it uses SOAP headers, and a number of other things that make it kind of difficult. On the converse, Amazon's REST web service can sometimes be tricky to parse because it can be highly nested, and the result schema can vary quite a bit based on what you search for.

 

Which ever architecture you choose make sure its easy for developers to access it, and well documented.

 

1)SOAP is a protocol.                                                                                                                   REST is an architectural style.

 

2) SOAP stands for Simple Object Access Protocol.                                 REST stands for REpresentational State Transfer.

 

3) SOAP can't use REST because it is a protocol.                                       REST can use SOAP web services because it is a concept and can use any protocol like HTTP, SOAP.

 

4) SOAP uses services interfaces to expose the business logic. REST uses URI to expose business logic.

 

5) JAX-WS is the java API for SOAP web services.                                 JAX-RS is the java API for RESTful web services.

 

6) SOAP defines standards to be strictly followed.                                 REST does not define too much standards like SOAP.

 

7) SOAP requires more bandwidth and resource than REST.                 REST requires less bandwidth and resource than SOAP.

 

😎 SOAP defines its own security.                                                                 RESTful web services inherits security measures from the underlying transport.

 

9) SOAP permits XML data format only.                                                 REST permits different data format such as Plain text, HTML, XML, JSON etc.

 

10) SOAP is less preferred than REST.                                                 REST more preferred than SOAP.

 

 

Mark Correct/Helpful if it helps you.

 

Thanks,

Apurva Malewadikar

www.DXSherpa.com

Very Helpful indeed!

Priyanka136
Mega Guru