Meaningless Drivel is fun!*
The moose likes Web Services and the fly likes One WS question from questionnaire Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "One WS question from questionnaire" Watch "One WS question from questionnaire" New topic
Author

One WS question from questionnaire

Vicky Roy
Greenhorn

Joined: Jan 09, 2014
Posts: 19
I was just doing some questions for Web Services certification. I have answer for the below question but I didn't get the logic. Can anybody help?

A company is refactoring an existing website to use Web services clients. The application retrieves lists
of parts and displays them to the users in a browser window. Previously, the data was stored as files on
the web server and, in order to access the files, the user would simply click on a hyperlink. Now the data
must be dynamically generated via a service that another developer has created. They want the easiest
way to refactor their website to use Web services. Which three client-side technologies should they use.?
(Choose three.)
A. SOAP
B. REST
C. Javascript
D. XML
E. JSON
F. JAVA

The answer is given B,C,E. But why? Please explain.

Thanks.
Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 1162
    
    1

normally web server resources are accessed by HTTP URL. Therefore, for this scenario, REST based web services shall be better (if not best) to implement.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42285
    
  64
normally web server resources are accessed by HTTP URL. Therefore, for this scenario, REST based web services shall be better (if not best) to implement.

SOAP also works via HTTP; as does any other JavaScript-in-a-browser based approach, so that is not a differentiating criterion.

Using REST, JSON and JavaScript would in most cases be the standard approach, assuming that the "service that another developer has created" is in fact a REST WS. If it is a SOAP WS, then the choices would be SOAP, XML and JavaScript.

REST is more easily processed than SOAP in a JavaScript environment. A library like jQuery can make that 4 lines of code. And JSON -being based on JavaScript- is a natural fit for a browser client - it can be converted back to JavaScript with one method call. Processing XML in JavaScript is much harder, as is sending and receiving SOAP requests.
Vicky Roy
Greenhorn

Joined: Jan 09, 2014
Posts: 19
Thanks for the clearcut explanation. If you don't mind then please look for other queries also.

http://www.coderanch.com/t/635450/Web-Services/java/SOAPFault-handler-mapped-wsdl#2912160
http://www.coderanch.com/t/635321/Web-Services/java/SEI-class-client-side-dynamic#2911489

Thanks a lot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: One WS question from questionnaire