Introduction To Web Services Interview Questions and Answers
A web service is an application that is accessed over the internet. It enables communication or exchanging information between two applications. It works on a client-server model, where clients can access easily over the internet. Web services use XML which is readily available on the internet as well as private networks. Their architecture includes SOAP (Simple Object Access Protocol), WSDL(Web Services Description Language), RESTful web services, etc.
Let us have a look at the Web Services Interview Questions :
Part 1 – Web Services Interview Questions (Basic)
This first part covers basic Web Services Interview Questions and answers
1) Define web service and also explain its different components?
This is the common Web Services Interview Questions asked in an interview. A web service is an application that is accessible over the internet which enables communication or exchange of information between two applications. They usually work on a client-server model where they can be accessed easily by the clients over the network. XML is mainly used for this purpose. The main components of web services are:
- SOAP- Simple Object Access Protocol
- UDDI- Universal Description, Discovery, and Integration
- WSDL- Web Service Description Language
- RDF- Resource Description Framework
- XML- Extensible Markup Language
2) What is UDDI and what are its features?
UDDI is a part of the XML based standard in service discovery layer of a protocol stack. It uses the language known as WSDL(Web Service Description Language) for its working. It finds web services and publishes those over the web like it is done from a directory. Its main features are:
1) It acts like a database containing all WSDL files together.
2) The various protocols used for communication are SOAP, COBRA, and Java RMI.
3) It is an open framework which is platform independent and can be used on any operating system.
4) It enables various businesses to identify each other and communicate over the internet.
4.5 (1,333 ratings)
3) Explain the approaches for developing SOAP web-based service?
There are two approaches to develop a SOAP-based web service.
1) Contract first approach: When a user uses this approach, they need to first define XML and WSDL and then java classes need to be derived in the contract.
2) Contract last approach: When going with this approach, a user must first define java classes and then the contract should be generated that normally has WSDL file from Java class.
let us move to the next Web Services Interview Questions
4) For a user to get a secured RESTful web service, what practices should be followed?
To have a secure service HTTP URL paths are used as a part of RESTful service. To have best-secured services then a user must follow the following practices:
1)Use methods like GET, POST, PUT, DELETE, etc. with proper restrictions. They should be executed with those restrictions.
2)Whenever an error is generated then proper HTTP error message should be invoked.
3)When a request for a session is made user-based authentication must be performed.
4)Validation should be performed on all inputs from a server for SQL injection attacks.
5)Always send sensitive data like username, session password etc through POST method. They should never
5) Define SOA Architecture?
SOA stands for Service Oriented Architecture which is defined as a pattern consisting of various services. This communication includes data exchange and coordination between various services. The basic principles of SOA are as below:
1)All services used should be stateless and should be having features for discoverability.
2)All services should be reusable to work and should be available to be used with different types of applications.
3)The contract should have a description of all services in a standardized way specified in the contract.
4)Service abstraction rule should be followed which specifies the service should not expose the way a functionality has been executed.
Part 2 – Web Services Interview Questions (Advanced)
Let us now have a look at the advanced Web Services Interview Questions.
6) List the operation types and its response which are used in WSDL?
WSDL has four types of operation type responses defined. They are as below:
- One way: It received a message but does not return any response.
- Request-Response: It receives a request and returns a response.
- Solicit-response: It sends the request and waits for the response.
- Notification: It sends the messages but does not send any response.
7) How can XML document be Marshal and Unmarshal in Java framework? Explain with an example?
Marshaling is considered to be a process of converting the XML document into Java readable format and un-marshaling is the reverse of this process. Let us see how Java unmarshals an XML document and then does it again.
JAXBContext jc= JAXBContext.newInstance (“com.acme.foo”);
// unmarshal from foo.xml
Unmarshaller u = jc.createUnmarshaller () ;
(FooObject)u.unmarshal (new File (“foo.xml”) );
// marshal to sytem.out
Marshaller m = jc.createMarshaller ();
m.marshal (fooObj, System.out);
let us move to the next Web Services Interview Questions
8) Explain the elements of a SOAP message?
SOAP has the following elements:
- Envelope: This is the mandatory root element. It is helpful in determining the start and end of the SOAP message and translates XML document.
- Header: This element constitutes header attributes of a message which contains information of an application. This element occurs multiple times and adds new features and functionalities.
- Body: It is defined as a child element of an envelope containing the derived data from XML and that can be exchanged as a part of SOAP message. It is compulsory to have this block and it contains all call and response messages.
- Fault element: If errors occur during the processing of messages then they are handled by this fault element. If there is an error then this element will appear as a part of the body.
9) Enlist the packages available in XML digital signature API?
The APIs present in a digital signature is:
10) Explain Entrust Identification, Entitlement, and Privacy services?
The Entrust Identification services provide security capabilities for ensuring secure transactions. Using this company can allow and control identities entrusted to perform web transactions. This is the most useful Web Services Interview Questions asked in a web service interview.
The Entrustment entitlement services help you verify services that are attempting to access web services. Privacy services ensure data encryption so that only concerned parties can access the needed data. It ensures confidentiality and security for the messages that are sent.
This has been a guide to List Of Web Services Interview Questions and Answers so that the candidate can crackdown these Web Services Interview Questions easily. Here in this post, we have studied about top Web Services Interview Questions which are often asked in interviews. You may also look at the following articles to learn more –
- Interview Questions You Should Learn On Windows
- Top 12 Jenkins Interview Questions And Answers
- Linux vs Windows – Find Out The 9 Most Awesome Differences
- Hadoop Admin Interview Questions | Most Useful And Top Asked
- 25 Most Amazing Python Interview Questions And Answers-You Should Know
- Jenkins vs Bamboo: Features
- Jenkins vs Travis CI: What are the Features
- Linux vs BSD: Want to know about benefits
- Jenkins vs TeamCity: Want to know the best Features