What is Web Service Testing?
Web Services Testing is testing of Web services and its Protocols like SOAP & REST. To test a Webservice you can
- Test Manually
- Create your own Automation Code
- Use an off-the shelf automation tool like SoapUI.
- Web service is is technology which allow communicate between different languages. It allow us to pass the data over the internet in easy way.
- In other word Web services provides an easy way to achieve interoperbility.
- It follow collection of standareds or protocols for exchanging information between two device over internet/network.
- Ex – Java can easilty interact with Ruby, Paython etc using Web Services.
- Request – A request which is initated by Client.
- Response – A respose send by server based on client request
SOAP (Simple Object Access Protocol)
- SOAP can interact with other programing language applications.
- It is just a protocol which is XML Based for accesing web service over the interne
- it has own security known as WS Security.
- Language and Platform indenpendent.
- It support only XML format
- It works with WSDL file only so we can’t have other format like JSON, Header etc..
Restful Web Services
- Rest stands for Representational State Transfer
- Platform dependent
- support multiple format like JSon, Html, XML, Plain text file too.
- Fast compared to SAP
- its not a protocol liks SOAP it just a architectural design.
- Restfull is most widly used now a days
- 1xx information based
- 2xx (ex. 200) Success
- 3xx Redirection
- 4xx Client Error
- 5xx Server Error
WebService Testing involves following steps –
- Understand the WSDL file
- Determine the operations that particular web service provides
- Determine the XML request format which we need to send
- Determine the response XML format
- Using a tool or writing code to send request and validate the response
WSDL (Web Services Description Language) is an XML based language which will be used to describe the services offered by a web service.
WSDL describes all the operations offered by the particular web service in the XML format. It also defines how the services can be called, i.e what input value we have to provide and what will be the format of the response it is going to generate for each kind of service.
Using SoapUI to Test the WebService
- Go to File > New Soap Project
- Enter the project Name and the WSDL URI location
- Click OK
- Expand the first request and double click on the ‘Request1’. It will display the SOAP request in the XML format.
- Enter the From Currency and To Currency
- Click on the submit button
- Response XML will be displayed right side pane.