- What is REST? …
- What is a RESTFul Web Services? …
- What is a “Resource” in REST? …
- What is the most popular way to represent a resource in REST? …
- Which protocol is used by RESTful Web services? …
- What are some key characteristics of REST? …
- What is messaging in RESTful Web services?
API & WebServices Testing Interview Questions & Answers – Part 1
report this adRelated Posts
Home > Interview > Interview Questions > Top 20 Web services interview questions
Web services interview questions are most asked questions if you are applying for software developer role. In this post, we will see multiple web services interview questions.
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.
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
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.
End point is nothing but URL which other application can use to access it.
wsimport is utility which generates java classes from WSDL. It is part of JDK 6.
This file provides endpoint details about JAX-WS web service which is deployed on tomcat.It is available at WEB-INF directory.For example:
|123456789||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>|
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.
Mainly used HTTP methods are GET, POST, PUT, DELETE, HEAD and OPTIONS
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.
@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 .
For testing SOAP : SOAPUIFor testing Restful 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:
While exposing the web services, these channels will be used for communication with the clients. Here HTTP / POST protocol transfers the information between the clients with secure mode. HTTP / GET protocol allows the clients to view transferred data partially at the browser’s address bar. SOAP is used for transferring confidential data safely.
Receive a response to a request as you normally would follow the below steps: Create a project, add WSDL Add Test suite, Test case and Test steps Run the request To add assertions: Click on the Add Assertions at the top of log tabs. Configure the assertions as per the type and data required.
WSDL stands for Web Service Description Language and is a document written in XML. It uses XML to define the service layer document which consists of the origin of the web service, headers, port types, and request and response data. This one can provide information about web methods and web services.
Data driven testing means to store our test data which includes input and expected output in an external data source called Excel / Database / XML file. Later, we need to iterate the data source using respective component. In SoapUI, Datasource and Datasource Loop test steps are used for performing data driven testing.
In SoapUI, XPath assertion is used for asserting the web service response value by specifying the absolute path. If the absolute path is matched with the response value, then the test case or test suite will be considered as PASS otherwise it will be notified as FAILED. We can see the results of assertion at bottom of the screen where the Assertion tab will have resultant information.
We 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.
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.
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.
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.
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.
What are main differences between API and web service?
- 1) What is API? …
- 2) What is API testing? …
- 3) What are the types of API testing? …
- 4) What are the protocols used in API Testing? …
- 5) What are the tools used for API Testing? …
- 6) What is API test environment? …
- 7) What is API framework?
What are the four examples of web services?