1,
Define Web Service?,
answer:A web service is a kind of software that is accessible on the Internet. It makes use of the XML messaging system and offers an easy to understand, interface for the end users.
<hr/>
2,
What is the difference between SOA and a web service?,
answer:SOA (Service-Oriented Architecture) is an architectural pattern that makes possible for services to interact with one another independently.\nWeb Services is a realization of SOA concept, that leverages XML, JSON, etc. and common Internet protocols such as HTTP(S), SMTP, etc.\nSOA is a system-level architectural style that tries to expose business. WOA is an interface-level architectural style that focuses on the means by which these service capabilities are exposed to consumers.
<hr/>
3,
What is SOAP?,
answer: SOAP (Simple Object Access Protocol) is a transport protocol for sending and receiving requests and responses on XML format, which can be used on top of transport protocols such as HTTP, SMTP, UDP, etc.
<hr/>
4,
What is REST?,
answer:REST (REpresentational State Transfer) is an architectural style by which data can be transmitted over transport protocol such as HTTP(S).
<hr/>
5,
What is the difference between a REST web service and a SOAP web service?,
answer:REST supports different formats like text, JSON and XML; SOAP only supports XML;\nREST works only over HTTP(S) on a transport layer; SOAP can be used different protocols on a transport layer;\nREST works with resources, each unique URL is some representation of a resource; SOAP works with operations, which implement some business logic through different interfaces;\nSOAP based reads can’t be cached, for SOAP need to provide caching; REST based reads can be cached;\nSOAP supports SSL security and WS-security(Web Service-security); REST only supports SSL security;\nSOAP supports ACID (Atomicity, Consistency, Isolation, Durability); REST supports transactions, but it is neither ACID compliant nor can provide two phase commit.
<hr/>
6,
How to decide which one of web service to use REST or SOAP? ,
answer:“REST vs SOAP” we can rephrased to \Simplicity vs Standard\. Of course, \Simplicity\ with REST at most cases wins, it wins in performance, scalability and support for multiple data formats, but SOAP is favored where service requires comprehensive support for security (WS-security) and transactional safety (ACID).
<hr/>
7,
What is WSDL?,
answer: WSDL (Web Services Description Language) is an XML format for describing web services and how to access them.
<hr/>
8,
How you define web service protocol stack?,
answer:It is basically set of various protocols that can be used to explore and execute web services. The entire stack has four layers i.e. Service Transport, XML Messaging, Service Description and Service Discovery.
<hr/>
9,
Can you define each of these layers of protocol stack? ,
answer:The Service Transport layer transfer messages between different applications, such as HTTP, SMTP, FTP, and Blocks Extensible Exchange Protocol (BEEP). The XML Messaging layer encodes messages in XML format so that messages can be understood at each end, such as XML-RPC and SOAP. The Service Description layer describes the user interface to a web service, such as WSDL. The Service Discovery layer centralizes services to a common registry and offer simple publish functionality, such as UDDI.
<hr/>
10,
Define XML – RPC?,
answer:It is a protocol that makes use of XML messages to do Remote Procedure Calls.
<hr/>
11,
What UDDI means?,
answer:UDDI stands for Universal, Description, Discovery, and Integration. It is the discovery layer in the web services protocol stack.
<hr/>
12,
Define Entrust Entitlements Service?,
answer:This service verifies entities that attempt to access a web service. For Example, the authentication service, the Entitlements Service ensures security in business operations.
<hr/>
13,
Define Entrust Privacy Service?,
answer: As its name implies, it deals with security and confidentiality. This service encrypts data to ensure that only concerned parties can access the data.
<hr/>
14,
What do you mean by PKI?,
answer: It means Public-Key Infrastructure.
<hr/>
15,
What tools are used to test a web service? ,
answer:I have used SoapUI for SOAP WS and Firefox poster plugin for RESTFul Servic
<hr/>
16,
If you have to choose one approach, then what will be your choice?,
answer:In my point of view, the first approach that is the contract-first approach is more feasible as compared to the second one but still it depends on other factors too.
<hr/>
17,
Is there any special application required to access web service?,
answer:No, you don’t need to install any special application to access web service. You can access web service from any application that supports XML based object request and response.
<hr/>
18,
Name browser that allows access to web service? ,
answer:JavaScript XmlHttpRequest object is required to access web service via browsers. The browsers that support this object are Internet Explorer, Safari and Mozilla-based browsers like FireFox.
<hr/>
19,
How one can provide API to users? ,
answer: To provide an API to the users, one can easily do this with an “open table”. All you need to do is to write open table which is basically an XML schema that point to a web service.
<hr/>
20,
Name the various communication channels in web service? ,
answer:Web service is integrated with three protocols such as HTTP/POST, HTTP/GET, and SOAP. It provides three different communication channels to clients. Client can choose any communication method as per requirements.
<hr/>
21,
How can you document web service?,
answer:Web services are contemplated as self-documenting because they provide entire information regarding the available methods and parameters used for XML based standard, known as WSDL. One can also provide more information to explain web services via their own WebService and WebMethod attributes.
<hr/>
22,
What are distributed technologies? ,
answer: The increasing ratio of distributed applications has raised demand for distributed technologies. It allows segmenting of application units and transferring them to different computers on different networks.
<hr/>
23,
Differentiate between web services, CORBA and DCOM?,
answer: Web services transfer/receive messages to/from application respectively, via HTTP protocol. It uses XML to encode data.\nCORBA and DCOM transfer/receive messages to/from application respectively, via non-standard protocols such as IIOP and RPC.
<hr/>24,
How a .NET web service is consumed? ,
answer:Since we know that web services are constructed on XML standards. Therefore, clients need to have complete understanding of XML-based messages to interchange messages. Clients can communicate with web services through .NET framework that offers proxy mechanisms. These proxy mechanisms have detailed information regarding data sharing within web services that can be easily used by the clients.
<hr/>25,
Can you name the two Microsoft solutions for distributed applications? ,
answer:The two Microsoft solutions for distributed applications are .NET Web Services and .NET Remoting.
<hr/>26,
Differentiate between .NET Web Services and .NET Remoting?,
answer:As far as protocol is concerned, .NET Web Service uses HTTP, while, .NET Remoting uses any protocol i.e. TCP/HTTP/SMTP. When it comes to performance, .NET Remoting is comparatively, faster than.NET Web Service. Also, as .NET Web Services are hosted via IIS, therefore, it is far more reliable than the .NET Remoting.
<hr/>27,
Name the components to be published while deploying a Web Service?,
answer:The components that need to be published during a web service deployment are Web Application Directory, Webservice.asmx File, Webservice.Disco File, Web.Config File and Bin Directory.
<hr/>28,
What are the steps performed by the client to access a web service?,
answer: First of all a web reference to the web service is created by the client in his application. Then a proxy class is generated. After that an object of the proxy class is created and at last, the web service is accessed via that proxy object.
<hr/>29,
How web services are implemented in .NET?,
answer:To implement web services in .NET, HTTP handlers are used that interrupt requests to .asmx files.
<hr/>30,
Explain few disadvantages of Response Caching? ,
answer:Response Caching is useless or incompetent when method accepts extensive amount of values because caching means to store lot of information. Also, if the method depends on external source of information, and that are not provided within the parameters then such methods are bypassed.
<hr/>31,
What is the alternate solution to Response Caching?,
answer:One can use Data Caching (System.Web.Caching.Cach) instead of Response Caching.
<hr/>32,
In Which Scenarios Restful Web Services Are Preferred Over Soap Ones?,
answer:RESTful Web Services are preferred when:n\na) The Web Services are completely stateless.\nb) When data can be cached to improve performance.\nc) Schema of data can be agreed between service consumer and service provider.\nd) Bandwidth is limited.
<hr/>33,
How Do You Refer Or Identify Resources In Rest Design Idiom?,
answer:Resources are identified by their unique URLs.
<hr/>34,
Is Rest Stateless Or Stateful Client-server Architecture?,
answer:REST is stateless client-server architecture.
<hr/>35,
Name The Java Api That Is Used For Building And Deploying Restful Web Services?,
answer:JAVA API for XML Web Services (JAX-WS) and\nJAVA API for XML RESTful Web Services (JAX-RS).
<hr/>36,
How Web Service Interface For Restful Web Services Are Described?,
answer:There is no formal way of describing the Web Service interfaces.\nTo overcome this, service producer and service consumer agree on schemas that describe the data being exchanged.
<hr/>37,
Name Few Of The Jax-rs Implementations?,
answer:Jersey, RESTEasy, Restlet are to name a few.
<hr/>38,
If I Plan To Use The Jersey Distribution For Restful Web Services, Do I Need To Download It?,
answer:Yes. But if you are using NetBeans IDE 6.0, downloading is not required.
<hr/>39,
How Are Resources Addressed? ,
answer:Each resource is uniquely addressable using a universal syntax for use in hypermedia links.
<hr/>40,
In Restful Architecture, What Represents The Application State And Functionality?,
answer:Uniquely Addressable Resources represent the application state and functionality.
<hr/>41,
What Is Shared Between Restful Resource That Is Used For Transfer Of State Between Client And Resource? ,
answer:A uniform interface is shared between resources that comprises of a set of well‐defined operations, content types and optionally supporting code-on-demand.
<hr/>42,
How Do You Annotate A Method To Respond To Http Get Requests? ,
answer:javax.ws.rs.Get annotation specifies that the annotated method will serve HTTP Get request.
<hr/>43,
List Resource Method Designator Annotations?,
answer: @GET, @PUT, @POST, @DELETE
<hr/>44,
Define Root Resource Class?,
answer:Root resource class is basically a POJO (Plain Old JAVA Objects) that is annotated with @Path and has at least one method annotated with @Path or have at least a single resource method.
<hr/>45,
What is RESTEasy ?,
answer:RESTEasy is another REST framework introduced in JBoss Application Server. This was rather easy REST interview questions. you can answer in detail only if you have used this or working in JBoss.
<hr/>46,
How to display custom error pages using RestFull web services ?,
answer:In order to customize error you need to extend StatusService and implement getRepresentation(Status, Request, Response) method with your custom code now assign instance of your CustomStatusService to appropriate \statusService property\
<hr/>47,
Which HTTP methods are supported by RestFull web services ? ,
answer: Another common REST interview question regarding RESTFul web service each Resource supports GET, POST, PUT and DELETE http methods.GET is mapped to represent(), POST - acceptRepresentation(), PUT- storeRepresentation and DELET for rmeoveRepresentation.
<hr/>48,
What is difference between top-down and bottom-up approach of developing web services ?,
answer:In top-down approach first WSDL document is created and than Java classes are developed based on WSDL contract, so if WSDL contract changes you got to change your Java classes while in case of bottom up approach of web service development you first create Java code and then use annotations like @WebService to specify contract or interface and WSDL field will be automatically generated from your build.
<hr/>
49,
What are the Transport methods in SOAP? ,
answer:Internet application layer is used to transfer messages from one end to another end.\nVarious products have been transported successfully from one end to another end using SOAP.\nBoth SMTP and HTTP are two successful transport protocols
<hr/>50,
How will you handle synchronization issues when multiple clients try to consume web service simultaneously? ,
answer:Similar to a servlet implemnetation, web service method implementation must take care of all synchronization issues. You can do this using synchronization.