?
Solved

When to use SOAP based web service and when to use REST based web services in JEE

Posted on 2014-03-04
9
Medium Priority
?
379 Views
Last Modified: 2016-02-26
When to use SOAP based web service and when to use REST based web services in JEE ?
While designing an application,which factors to should be considered for decision making and how one compare SOAP and REST in such cases ?
0
Comment
Question by:mrayandutta
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 

Author Comment

by:mrayandutta
ID: 39915380
Any update from anuybody ?
0
 
LVL 25

Accepted Solution

by:
apeter earned 672 total points
ID: 40001459
Both are platform independent protocols. Both can support xml and json types

If you are planning to support mobile/tablet devices then rest based calls will be useful since they are light weight.
0
 

Author Comment

by:mrayandutta
ID: 40001671
Hi,
Thanks for your reply .
As you mentioned botha can support xml and json and rest is lightweight .
By lightweight what actually you mean in this context ? Is it the required library dependency for soap based frameworks ? Why I am asking this is because if both support json and xml then in terms of output the response is same .
I want to know the specific reason how REST based web services are lighter compared to Soap based once .
0
Give Your Engineering Team a Productivity Boost

Learn why container technology is so powerful and how it can provide your team with productivity gains and other benefits.

 
LVL 16

Expert Comment

by:Valeri
ID: 40001721
read the last section of this article SOAP vs REST...
http://blog.manishchhabra.com/2013/04/rest-and-soap-web-services-analogy/
REST based web services are lighter because they don't have a lot of extra markups in the XML, the protocol is not strongly defined (like it's in SOAP) and it's up to you how to represent the data and how to serialize objects to xml and back again.
0
 
LVL 34

Assisted Solution

by:Slick812
Slick812 earned 664 total points
ID: 40001917
Hi  mrayandutta, , there are many references about both Soap and Rest server exchanges on the web. And just saying that a Rest is " lighter compared to Soap", does not give any useful info,

So you ask -
"I want to know the specific reason how REST based web services are lighter compared to Soap based once ?"

My opinion is that if you do NOT have experience in the very difficult task of setting up a functional "Soap" exchange, you should try and do a the Rest exchange.

In a Rest, you have an API page that tells the developers what Page Request to send to your server, the necessary parameters and format of that request (a POST or GET or other), and then it will explain what to expect in the return, and what FORMAT the data "Text" (json, xml, other) will be in, ,  and the Function (actually request calls) return data from your server, most all of this can be custom designed by the server developers.

However, in a Soap exchange, it is REQUIRED the the Page Request be in a Formal XML Soap format, The Soap XML has function AND Object "NameSpace Definitions" that uses xmlns:  to retrieve the correct the Soap Function calls,  You can use a NameSpace to define ARRAYS with Structures, and or DataTypes.
As the name SOAP (Simple Object Access Protocol) implies, programming Object- Properties - Methods can be set and you can "bind" to Objects within their DataTypes.

Unlike the Rest, the Soap sets up a Data-Type, Function, Object-Method API definition set in the XML, and setting up this Wacky-Confusing Soap-Specification XML nameSpace for accuall use, is NOT EASY! ! You will have to test and debug, again and again in development, Because you can have poor code in the XML namespace, your the XML function calls, or your server code. You will likely have to show examples on HOW to use your Server Soap API in several different server-side languges (ASP, JSP, PHP).

But that just my opinion.
0
 

Assisted Solution

by:dantanala giribabu
dantanala giribabu earned 664 total points
ID: 40219284
Prefer SOAP if:

If you need end-to-end kind of services (not point-to-point)
         
end-to-end: client->destination1->destination2->destination3->endpoint
         
point-to-point:client->endpoint
If your request/response derived from schema (xml)
If you need support of different transportation protocols (HTTP, SMTP, TCP, UDP, or JMS),
If you need message level security (check ws - security)
If you are concern more about standards
SOAP is enterprise application ready

Prefer REST if

Point-to-Point services
Supports different formats (XML, JSON etc)
Supports only http and https (and its methods)
Very light weight (no need to pass schema prefixes, schema locations etc) (please refer how SOAP reqeust/response and JSON request and response, you well get an idea how much heavy is SOAP req/resp)
Supports only transportation level security (i.e. https)

Please let me know if you need anything more, so i can provide.

Thanks,
Dantanala
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month11 days, 20 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question