1) Define Web Service?
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.
2) What is new in this field for past few years?
The initiation of XML in this field is the advancement that provides web service a single language to communicate in between the RPCs, web services and their directories.
3) 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.
4) How you define web service protocol stack?
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
5) Can you define each of these layers of protocol stack?
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.
6) Define XML – RPC?
is a protocol that makes use of XML messages to do Remote Procedure Calls.
7) Define SOAP?
SOAP is an XML based protocol to transfer between computers.
8) Define WSDL?
means Web Services Description Language. It is basically the service description layer in the web service protocol stock. The Service Description layer describes the user interface to a web
9) What kind of security is needed for web services?
The security level for web services should be more than that of what we say Secure Socket Layer (SSL). This level of security can be only achieved from Entrust Secure Transaction Platform. Web
services need this level of security to ensure reliable transactions and secure confidential information .
10) Do you have any idea about foundation security services?
implies from its name, these services are the foundation or basics of integration, authentication, authorization, digital signatures and encryption processes.
11) Define Entrust Identification Service?
Entrust Identification Service comes from the Entrust Security Transaction Platform. This platform allows companies to control the identities that are trusted to perform transactions for Web services
12) What UDDI means?
UDDI stands for Universal, Description, Discovery, and Integration. It is the discovery layer in the web services protocol stack.
13) Define Entrust Entitlements Service?
This service verifies entities that attempt to access a web service. For Example, the authentication service, the Entitlements Service ensures security in business operations.
Entrust Privacy Service?
its name implies, it deals with security and confidentiality. This service encrypts data to ensure that only concerned parties can access the data.
15) What do you mean by PKI?
means Public-Key Infrastructure.
16) What tools are used to test a web service?
have used SoapUI for SOAP WS and Firefox poster plugin for RESTFul Services.
17) Differentiate between a SOA and a Web service?
SOA is a design and architecture to implement other services. SOA can be easily implemented using various protocols such as HTTP, HTTPS, JMS, SMTP, RMI, IIOP, RPC etc. While Web service, itself is an
implemented technology. In fact one can implement SOA using the web service.
18) Discuss various approaches to develop SOAP based web service?
can develop SOAP based web service with two different types of approaches such as contract-first and contract-last. In the first approach, the contract is defined first and then the classes are
derived from the contract while in the later one, the classes are defined first and then the contract is derived from these classes.
19) If you have to choose one approach, then what will be your choice?
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.
20) Is there any special application required to access web service?
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.
21) Can you name few free and commercial implementations for web services?
The implementations I know are Apache SOAP, JAX-WS Reference Implementation, JAX-RS Reference Implementation, Metro, Apache CXF, MS.NET and Java 6.
22) Name browser that allows access to web service?
23) What is REST?
REST stands for Representational State Transfer. REST itself is not a standard, while it uses various standards such as HTTP, URL, XML/HTML/GIF/JPEG (Resource Representations) and text/xml,
text/html, image/gif, image/jpeg, etc (MIME Types).
24) How one can provide API to users?
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.
25) Name the various communication channels in web service?
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
26) How can you document web service?
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.
27) What are the situations, when we need ASP.NET web services?
ASP.NET web services are used when one need to implement three tier architecture in a web service. It allows handy ways to use middle tier components through internet. The main advantage of .NET Web
services is that they are capable enough to communicate across firewalls because they use SOAP as transport protocol.
28) What are distributed technologies?
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
29) Differentiate between web services, CORBA and DCOM?
Web services transfer/receive messages to/from application respectively, via HTTP protocol. It uses XML to encode data.
CORBA and DCOM transfer/receive messages to/from application respectively, via non-standard protocols such as IIOP and RPC.
30) Can you tell few benefits of web services?
The biggest advantage of web service is that is supported by wide variety of platforms. Moreover, in near future, web services may spread its boundary and enhance new methods that will provide ease
to clients. The enhancement will not affect the clients, even if they offer old methods and parameters.
31) Can you name some standards used in web services?
The standards used in web services are WSDL (used to create interface definition), SOAP (used to structure data), HTTP (communication channels), DISCO (used to create discovery documents) and UDDI
(used to create business registries).
32) Explain in brief, what DISCO is?
DISCO means discovery. It groups the list of interrelated web services. The organization that provides web services, issues a DISCO file on its server and that file contains the links of all the
provided web services. This standard is good when client knows the company already. Also it can be used within a local network as well.
33) Explain in brief, what UDDI is?
UDDI (Universal Description, Discovery, and Integration) provides consolidated directory for web services on the internet. Clients use UDDI to find web services as per their business needs. It
basically hosts the web services from various companies. In order to share web services, you need to publish it in UDDI.
34) Explain the .NET web services supported data types?
.Net web services uses XML-based standards to transfer/receive information. Thus, .NET web services can only works with data types known by XML schema standard. Like FileSteam, Eventlog etc. are not
recognized by the XML schema standards and hence, not supported in web services.
35) How a .NET web service is tested?
ASP.NET uses a test page routinely, when one calls for the URL of .asmx file in any browser. This page shows complete information regarding web services.
36) How a .NET web service is consumed?
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
37) Can you name the two Microsoft solutions for distributed applications?
The two Microsoft solutions for distributed applications are .NET Web Services and .NET Remoting.
38) Differentiate between .NET Web Services and .NET Remoting?
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.
39) Name the components to be published while deploying a Web Service?
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.
40) What are the steps performed by the client to access a web service?
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.
41) How web services are implemented in .NET?
implement web services in .NET, HTTP handlers are used that interrupt requests to .asmx files.
42) Explain few disadvantages of Response Caching?
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.
43) What is the alternate solution to Response Caching?
One can use Data Caching (System.Web.Caching.Cach) instead of Response Caching.
44) Brief few drawbacks of using GET and POST methods to communicate with the web service?
These methods are less secure and inhibit users to pass structures and objects as arguments. Also, it doesn’t allow users to pass ByRef arguments.
45) How can one access a class as a web service?
access a class as a web service, one should inherit the class from the System.Web.Services.WebService class and qualify the class with the WebService attribute.
46) How can one access the web service class method via internet?
access web service class method via internet, one should qualify a method with the WebMethod attribute.
47) How a SOAP message is structured?
SOAP message is consists of SOAP Envelope, SOAP Headers, and SOAP Body.
48) Can you name different kinds of web services?
There are two types of web services in total i.e. SOAP based web service and RESTful web service.
This question is already mentioned earlier.
49) What’s different in RESTful web services?
The RESTful web services contains no contract or WSDL file.
50) Give me few reasons to use RESTful web service?
The RESTFul web services are simple to implement and test. It supports various data formats such as XML, JSON etc.
Soap Based Java web services, I am here sharing a list
of frequently asked web service interview questions. These questions include those asked to me in over 50 interviews I have appeared so far and also I use these questions in interviews I take. For
some of the questions, I have already written tutorials with code samples. For example, I have written on WSDL structure, SOAP handlers, message attachments and wsimport tool.
1) What is the
difference between SOAP and REST web services?
Ans: These is one of the most frequently asked question in Java interviews. Don’t go to interview without reading some content on how these two kind of web services behave. I shall write in detail
about the differences between the two in future but for now bear in mind that they are completely different approaches to achieve the same target. The debate on which one is better has no end but
when answering this question, you need to make sure that you keep the balance between the two and mention pros and cons of each type of web services.
While SOAP based web services rely heavily on XML standard, REST web services use the HTTP protocol methods PUT, GET, DELETE and POST for operations.
If you haven’t written both kind of web services code then let me tell you first hand that it is very easy to write REST web services without making mistakes. For both SOAP and REST web services, there are frameworks out there in market which make the task of
writing the web services simpler.
Another important difference which you should be
mentioning in the answer to this question is that while REST web services can be invoked using simple HTTP clients and browser add-on , the invocation of SOAP based web services require some learning
curve and creation of XML messages. The use HTTP helps web developers who may not have got much chance to play with XML.
2) Since JSP, ASP
and PHP pages can be browsed by anyone using a HTTP client and hence platform independence, then what kind of platform independence do SOAP based web services bring?
Ans: JSP, ASP and PHP were not designed for platform independence but for writing code which can be sent to the web browser for rendering. There are no means by which a standard
can be set between the developer and consumer of these websites designed using PHP, ASP, JSP. On the other hand, SOAP based web services define a protocol standard to have communication between the
producer and consumer of web services. So basically the difference lies in the purpose for which these technologies were founded.
3) What are the
components of WSDL and their significance?
Ans: WSDL provides information about the structure of SOAP message to be sent for invocation of different operations exposed by the web service.I have written a tutorial on WSDL components and their meaning.
4) Can we modify
the header and body parts of SOAP messages so that some common operations like logging can be performed?
Ans: This can be achieved by using interceptors which intercept the message before sending and receiving it. An interceptor can be written on the client or server side and perform its job as defined
in the code. These interceptors are known as handlers in JAX-WS specification. There are SOAPHandlers and LogicalHandlers which can do different processing on the server side and client side.
5) What steps do
you follow for debugging the issues in your code?
Ans: There are a number of debugging techniques available for SOAP based web services. Every developer has its own set of favorite ways to find issues. Some of the commonly used ways to debug web
- Monitoring web services requests and response using
some traffic analysis tools like tcpdump or Eclipse TCP/IP monitor.
- Use some tools like soapUI or IBM InfoSphere
- Use logs or System.out.println() for checking any
- Mention any special debugging techniques you have been
using in your web services code.
the types of information included in SOAP header?
Header of SOAP contains information
1. In SOAP header client should handle authentication and transaction.
2. The SOAP message should process by client.
3. EncodingStyle is also has in header.
you explain HTTP Binding in SOAP ?
Let us start with and example to
inform you HTTP perform communication over TCP/IP.And TCP HTTP client can connect to an HTTP server.
When connection will established than using that connection client can send an HTTP request message to the server.
POST /item HTTP/1.1
Server processes this request and sends an HTTP response back to the client. The response contains has a status code that are use to indicate the status of the request.
This server returned a status code of 200.This is also called as standard success code for HTTP.
If the server has unable to decode the request, it can returned something like.
400 Bad Request
SOAP HTTP Binding: We use SOAP method to complies with the SOAP encoding rules.
HTTP + XML = SOAP
A SOAP request may be an HTTP POST or an HTTP GET request.
HTTP POST request specifies at least two HTTP headers:
1. Content-Type: In case of Soap request and response, Content-Type header defines the MIME type for the message and the character encoding ( that is optional) used only for XML body of the request
POST /item HTTP/1.1
Content-Type application/soap+xml; charset=utf-8
2. Content-Length: Using Content-Length header we specifies the number of bytes in the body of the request or response for a SOAP request and response.
POST /item HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8
the differnece between fault and exception in Apache SOAP?
Difference b/w the fault and exception
depends upon where these error occurs, may be they occour on client side or on server side.
Exception occurs on client side where as faulut occur on server side.
I have explain you with an example.We send an SOAP encoded request for which method that does not exist results in a SOAP fault whereas when server sends a response with a field that does not
exist in a client side class
the software components that we must used to build a SOAP server?
XML processor and HTTP Server are
mandatory when you want to build SOAP Server.We have to use some other tools when you deal with different language.
When you deal with Visual Basic 6.0 or VBA than you must have to use either Microsoft SOAP TOOLkit or PocketSOAP.
When you deal with VB.Net or C# than you must have to use Visual Stdio.Net or .Net Framework.
When you deal with Delphi than you have to use Borland’s Web services.
When you deal with C++ than you have to use Systinet WASP Server for C++ or gSOAP.
When you deal with Java,Than their is a many choices for you like: Apache Axis, Systinet WASP Server for Java, The Mind Electric GLUE, Cape Clear Cape Connect, BEA Workshop, etc.
Most likely Java environments are WASP, GLUE, and Axis.
SOAP and how we can utilize this with Web components ?
SOAP is stands for Simple Object
Access Protocol. SOAP was first comes in 1990 after that in 2000 it introduced to W3C.
In Web Component we use SOAP to send an request for to invoke programs on remote computers with using XML wrappers.
The main purpose to use SOAP in Web Service is that to send messages over HTTP protocol.
the element that we used in SOAP?
1. An envelope element is used to
identifies and translates the XML document into a SOAP message.
2. A header element is used to contain header message.
3. A body is used to contain call and response message.
4. Fault element is used to communicate about the errors occurred during the process.
the disadvantages of SOAP?
Some disadvantages .
1. It is much slower than middleware technologies.
2. Because we used HTTP for transporting messages and not use to defined ESB or WS-Addressing interaction of parties over a message is fixed.
3. Application protocol level is problematic because usability of HTTP for different purposes is not present.
Introduction to Restful Web Services Using JAX-RS
RESTful web services are built to work best on the Web.
Representational State Transfer (REST) is an architectural style that specifies constraints, such as the uniform interface, that if applied to a web service induce desirable properties, such as
performance, scalability, and modifiability, that enable services to work best on the Web. In the REST architectural style, data and functionality are considered resources and are accessed using
Uniform Resource Identifiers (URIs), typically links on the Web. The resources are acted upon by using a set of simple, well-defined operations. The REST architectural style constrains an
architecture to a client/server architecture and is designed to use a stateless communication protocol, typically HTTP. In the REST architecture style, clients and servers exchange representations of
resources by using a standardized interface and protocol.
RESTful Web Services utilize the features of the HTTP Protocol to
provide the API of the Web Service. It uses the HTTP Request Types to indicate the type of operation:
GET: Retrieve / Query of existing records.
POST: Creating new records.
DELETE: Removing records.
PUT: Updating existing records.
Using these 4 HTTP Request Types a RESTful API mimics the CRUD
operations (Create, Read, Update & Delete). REST is stateless, each call the to a RESTful Web Service is completely stand-alone, it has no knowledge of previous requests.
We are giving simple examples to create restful web services using
What Are RESTful Web Services?
Java API for RESTful Web Services
Jersey User Guide
Web Services Examples
- See more at: