Wednesday, December 5, 2012

Web Services Interview Questions

WEB SERVICES 

What is a webservice ?

web service is a network accessible interface to application functionality, built using standard Internet technologies. 



                                  

A web service allows access to application code using standard Internet technologies


In other words, if an application can be accessed over a network using a combination of protocols like HTTP, XML, SMTP, or Jabber, then it is a web service. Despite all the media hype around web services, it really is that simple.
Web services are nothing new. Rather, they represent the evolution of principles that have guided the Internet for years. 
          Web Services support loosely coupled  connections. The interface of the Web Service provides a layer of abstraction between the client and the server. The loosely coupled applications reduce the cost of maintenance and increases re-usability. 
            
          Web Services present a new form of middle-ware based on XML and Web. Web services are language and platform independent. You can develop a web service using any language andeploy it on to any platform, from small device to the largest supercomputer. Web Service uses language neutral protocols such as HTTP and communicates between disparate applications by passing XML messages to each other via a Web API which do work across internet, less expensive and easier to use.

1.What are the different styles of Web Services used for application integration ?
  •       SOAP WS (Web Service)and RESTful Web Service.
 SOAP - Simple Object Access Protocol.
  REST -  Representational State Transfer
    2.What are the differences between both SOAP WS and RESTful WS ?
    1. The SOAP WS supports both remote procedure call (i.e RPC) and message oriented middle- ware(MOM) integration styles. 
    2. The RESTful Web Service supports only RPC integration style.
    3. The SOAP WS is a transport protocol neutral. Supports multiple protocols like HTTP(s), Messaging, TCP, UDP SMTP, etc.
    4.  The REST is transport protocol specific. Supports only HTTP or HTTPS protocols.
    5.   The SOAP WS permits only XML data format. you define operations, which tunnels through the POST. The focus is on accessing the named operations and exposing the application logic as a service.
    6. The REST permits multiple data formats like XML, JSON data, text, HTML, etc. Any browser can be used because the REST approach uses the standard GET, PUT,POST,and DELETE Web operations. The focus is on accessing the named resources and exposing the data as a service.
    7. REST has AJAX Support. It can use the XMLHTTpRequest object. Good for Stateless CRUD(Create,Read,Update and Delete ) operations.
    8. SOAP based reads cannot be cached. REST based reads can be cached. Performs and scales better.
    9. SOAP WS supports both SSL-Security and WS-Security, which adds some enterprise security features like maintaining security right up to the point where it is needed, maintaining identities through intermediaries and just not point to point SSL only, securing different parts of the message with different security algorithms, etc. The REST supports only point-to-point SSL Security. The SSL encrypts the whole message, whether all of it is sensitive or not.
    10. The SOAP has comprehensive support for both ACID based transaction management for short-lived transactions and compensation based transaction management for long-running transactions. It also supports two-phase commit across distributed resources. 
    11. The REST supports transactions, but it is neither ACID compliant nor can provide two phase commit across distributed transactional resources as it is limited by its HTTP protocol.
    3. How would you decide what style of Web Service to use ?
    • In general, a REST based Web Service is preferred due to its simplicity, performance, scalability, and support for multiple data formats. 
    • SOAP is favored where services requires comprehensive support for security and transactional reliability.
    4. Does the Service expose data or business logic ?
    •  REST is a better choice for exposing data, SOAP WS might  be a better choice for logic.
    5. What level of security is required ?
    • SOAP WS has better support for security than REST.
    6. What's best for the developers who will build clients for the service ?
    • REST is easier to implement, test, and maintain.
    7. What tools do you use to test your Web Service ?
    • SOAP UI for SOAP WS and the Firefox "poster" plugin for RESTful services.
    8. What is the difference between SOA and Web Service ?
    • SOA is a software design principle and and architectural pattern for implementing loosely coupled, reusable and coarse grained services. You can implement SOA using any protocols such as HTTP, HTTPS,JMS,SMTP,RMI,IIOP (i.e., EJB uses IIOP), RPC etc. Messages can be in XML or Data Transfer Objects (DTOs).
    • Web Service is an implementation technology and one of the ways to implement SOA. You can build SOA based applications without using Web Services- for example by using other traditional technologies like Java RMI, EJB, JMS based messaging, etc. But what Web Services offer is the standards based and platform-independent service via HTTP, XML,SOAP,WSDL and UDDI, thus allowing interoperability between heterogeneous technologies sucha as JEEE and .NET.

    1 comment:

    1. Thank you Admin for your post and it was quite helpful for learners like me.And While on the search I saw Java Web Services Online Training by Smart Mind Online Training with +15 experts,live project,24*7 support.I think it will help me to learn in depth of Core Java like this site and may be useful to others like me who searching for Java Web Services Online Training,.

      India : +91 9949599844
      US : + 1-347-606-2716
      Email:contact@smartmindonlinetraining.com

      ReplyDelete