Table of Contents
- 1. What are web services?
- 2. What are features of web services?
- 3. What are different types of web services?
- 4. What is SOAP?
- 5. What are important components for SOAP?
- 6. What is WSDL?
- 7. What is UDDI?
- 8. What is JAX-WS?
- 9. What are some important annotations for JAX-WS?
- 10. What do you mean by end point in terms of SOAP?
- 11. How can you access WSDL for web service?
- 12. What is wsimport?
- 13.What is sun-jaxws.xml file?
- 14. What are Restful web services?
- 15.What are HTTP methods that can be used with Restful web services?
- 16. What is JAX-RS?
- 17. What are some important annotations which you use to create Restful web services?
- 18. Â What are ways to test SOAP web services?
- 19. How to choose between REST and SOAP web services?
- 20. What are differences between SOAP and REST web services?
In this post, we will see multiple web services interview questions.
1. What are web services?
Lets say you are java developer, you can create web service and expose API over internet and any other developer (lets say .net developer ) can access it.
2. What are features of web services?
- Interoperability
- Reuse already developed(old) functionality into new software:
- Loosely Coupled
- Extensibility
3. What are different types of web services?
- SOAP
- Restful web services
4. What is SOAP?
SOAP stands for Simple object access protocol. It is protocol to exchange information using request and response in XML format over transport protocol such as HTTP, SMTP etc.
5. What are important components for SOAP?
- Simple access object protocol (SOAP)
- Web Services Description Language (WSDL)
- Universal Description, Discovery and Integration(UDDI)
6. What is WSDL?
WSDL stands for Web Service Description Language. It is an XML file that describes the technical details of how to implement a web service, more specifically the URI, port, method names, arguments, and data types. You can understand following details using WSDL
-   Port / Endpoint – URL of the web service
- Â Â Â Input message format
- Â Â Â Output message format
- Â Â Â Security protocol that needs to be followed
- Â Â Â Which protocol the web service uses
7. What is UDDI?
8. What is JAX-WS?
JAX-WS stands for Java API for XML Web Services. JAX-WS is standard XML based Java API which is used to create SOAP web services.
9. What are some important annotations for JAX-WS?
- @WebService
- @WebMethod
- @SOAPBinding
10. What do you mean by end point in terms of SOAP?
End point is nothing but URL which other application can use to access it.
11. How can you access WSDL for web service?
WSDL url: http://localhost:8080/WS/HelloWorld?wsdl
12. What is wsimport?
wsimport is utility which generates java classes from WSDL. It is part of JDK 6.
13.What is sun-jaxws.xml file?
This file provides endpoint details about JAX-WS web service which is deployed on tomcat.It is available at WEB-INF directory.
For example:
1 2 3 4 5 6 7 8 9 |
<?xml version="1.0" encoding="UTF-8"?> <endpoints xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime" version="2.0">  <endpoint     name="HelloWorldWS"     implementation="org.arpit.javapostsforlearning.webservice.HelloWorldImpl"     url-pattern="/HelloWorldWS"/> </endpoints> |
14. What are Restful web services?
In the web services terms, REpresentational State Transfer (REST) is a stateless client-server architecture in which the web services are viewed as resources and can be identified by their URIs. Web services client uses that URI to access the resource.
15.What are HTTP methods that can be used with Restful web services?
Mainly used HTTP methods are GET, POST, PUT, DELETE, HEAD and OPTIONS
16. What is JAX-RS?
Java API for RESTful Web Services (JAX-RS), is a set if APIs to create web service which supports REST architecture. JAX-RS is part of the Java EE6, and help developers to create REST web application easily.
17. What are some important annotations which you use to create Restful web services?
@Path :Â This is used to set path for URI at class level or method level
@GET,@POST,@PUT,@DELETE Â : There are annotations corresponds to HTTP methods
@Produces(MediaType.TEXT_XML [, more-types ]): @Produces defines which MIME type is delivered by a method
@PathParam:Â Used to inject values from the URL into a method parameter.
@Consumes(MediaType.TEXT_XML) : @Cosumes defines which MIME type will be consumed by the method .
18. Â What are ways to test SOAP web services?
For testing SOAP :
SOAPUI
For testing Restful web services:
- Postman for chrome browser
- poster for firefox
19. How to choose between REST and SOAP web services?
- If you want to implement web services in less time, go with REST
- If you know your client beforehand , then you can choose SOAP. If you are not aware about clients then go with REST.
- If you want to work with different format other than XML, go with REST. SOAP only supports XML format.
20. What are differences between SOAP and REST web services?
You can refer to difference between SOAP and REST web services for more details.
That’s all about Web services interview questions.
You may also like:
- restful web services interview questions
- Data structure and algorithm Interview Questions
- Spring interview questions
- Hibernate interview questions
- Core java interview questions
- Java Collections interview questions
- Java String interview questions
- OOPs interview questions in java
- Java Multithreading interview questions
- Exceptional handling interview questions in java
- Java Serialization interview questions in java
Hi,
thanks for these amazing questions.
I think you have a typo in question 8.
baed should be based ?
nice information