Friday 26 July 2013

Web Service interview questions



1)      What is the Web service protocol stack?

The Web service protocol stack is an evolving set of protocols used to define, discover, and implement Web services. The core protocol stack consists of four layers:

Service Transport: This layer is responsible for transporting messages between applications. Currently, this includes HTTP, SMTP, FTP, and newer protocols, such as Blocks Extensible Exchange Protocol (BEEP).


XML Messaging: This layer is responsible for encoding messages in a common XML format so that messages can be understood at either end. Currently, this includes XML-RPC and SOAP.

Service Description: This layer is responsible for describing the public interface to a specific Web service. Currently, service description is handled via the WSDL.

Service Discovery: This layer is responsible for centralizing services into a common registry, and providing easy publish/find functionality. Currently, service discovery is handled via the UDDI.

You do not need to understand the full protocol stack to get started with Web services. Assuming you already know the basics of HTTP, it is best to start at the XML Messaging layer and work your way up.

      2)   What is a synchronous web service?

Get response immediately.

3)      What is an asynchronous web service?

Response will be sent when the service is available.

4)       What is SOAPUI?

It is a tool to test the WebServices.

5)       What is xml schema?

XML schema is well defined xml structure. It is w3 standards.

            6)       Advantages of Web Services?

1. Interoperability: Most important benefit of Web services, its work outside of private networks and offering developers to find their solutions in appropriate way. Its provide Interoperability between many software's running ion different platform. Web Services are virtually platform-independent

2. Reusability: Web services use open standards and protocols. Deployment of services possible easily because they are not a component-based model of application for development. This makes it easy to reuse Web Service components as appropriate in other services.

3. Deploy ability: Web services deploy over the Web and any user use this without any independent and mapping problems.

4. Usability: Web services allow the reuse of services and components within an infrastructure. Web Services allow the business logic of different platform and exposed it over the Internet. This thigh provides the facility to use web services anywhere for different platform.

7)      Disadvantages of Web Services?


1. Web services suffered poor performance in comparison other distributed application RMI, CORBA, or DCOM.
 
2. XML explicitly does not count among its design goals either conciseness of encoding or efficiency of parsing.
 
3. Transaction in Web Services is not infancy like other distributed standards like CORBA. The web service transaction is nonexistent.
 
4. When client make a request to the server. When  the server  response at that time if power gone and client end crash, in this condition server never known that client not activated.
 
8)       Give me an example of real web service?

One example of web services is IBM Web Services browser. You can get it from IBM Alphaworks site. This browser shows various demos related to web services. Basically web services can be used with the help of SOAP, WSDL, and UDDI. All these, provide a plug-and-play interface for using web services such as stock-quote service, a traffic-report service, weather service etc.

9)      How do we know the project has WebServices?

You need to know the application architecture which is explained by your team.
You need to login to the servers and see if any wsdl files, WebServices running on the server where the application is deployed.
Check for the process running the server.

10)  What is SOAP?

SOAP is an XML-based protocol for exchanging information between computers. Although SOAP can be used in a variety of messaging systems and can be delivered via a variety of transport protocols, the main focus of SOAP is Remote Procedure Calls (RPC) transported via HTTP. Like XML-RPC, SOAP is platform independent, and therefore enables diverse applications to communicate with one another.

To get a quick sense of SOAP, here is a sample SOAP request to a weather service (with the HTTP Headers omitted): 

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:getWeather 
xmlns:ns1="urn:examples:weatherservice"
SOAP-ENV:encodingStyle=" http://www.w3.org/2001/09/soap-encoding
<zipcode xsi:type="xsd:string">10016</zipcode>
</ns1:getWeather>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
As you can see, the request is slightly more complicated than XML-RPC and makes use of both XML namespaces and XML Schemas. Much like XML-RPC, however, the body of the request specifies both a method name (getWeather), and a list of parameters (zipcode).

Here is a sample SOAP response from the weather service:

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:getWeatherResponse
xmlns:ns1="urn:examples:weatherservice"
SOAP-ENV:encodingStyle="http://www.w3.org/2001/09/soap-encoding">
<return xsi:type="xsd:int">65</return>
</ns1:getWeatherResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The response indicates a single integer return value (the current temperature). 
The World Wide Web Consortium (W3C) is in the process of creating a SOAP standard. The latest working draft is designated as SOAP 1.2, and the specification is now broken into two parts. Part 1 describes the SOAP messaging framework and envelope specification. Part 2 describes the SOAP encoding rules, the SOAP-RPC convention, and HTTP binding details. 

No comments:

Post a Comment