HomeSOAPUI

Web services testing in SoapUI

Web services testing in SoapUI
Like Tweet Pin it Share Share Email

Web services testing in SoapUI can be done for both SOAP and REST, in this article you will know how to use SoapUI to test SOA protocol based Web Service.

One of the advantages of SoapUI tool is it can be used by any one , they just need to know how an XML looks and how are the nodes structured in the XML file. Its been used by both automation test engineers and manual testers.

For this article we are using the below web service wsdl which is publicly available to perform web services testing.

WSDLhttp://www.webservicex.com/globalweather.asmx?wsdl

The above web service is used to get the list of cities when a country name is passed as input and gets weather details when Country and City Name are provided as inputs using 2 of its methods.

Step by Step instructions to test web services in SoapUI

  • Launch SoapUI tool
SoapUI Tool
SoapUI Tool

  • Click on SOAP Icon SOAP Icon to launch SOAP Project Wizard
  • Enter Details of the project Name & WSDL which you want to use for testing in the respective fields and click on OK button.
Soap Project Wizard
Soap Project Wizard
  • SoapUI tool parses the WSDL url and then shows you a tree structure with list of Projects > Processes > Methods > SOAP Requests.
SOAP Project Structure
SOAP Project Structure
  • Double click request you want to submit or right click and select “Show Request Editor” in the context menu to work with the request XML in the editor.
Open Request Editor
Open Request Editor
  • Every SOAP request will have nodes by names Envelope, Header and Body, you can see this now in the Request Editor window.
SOAP Request Editor
SOAP Request Editor
  • Under the body you can see the list of Processes > Methods > Parameters in form of XML Nodes
  • Here in this example, you can see one parameter “CountryName” for the method “GetCitiesByCountry”
  • Enter United States as input for CountryName parameter.
Request Payload
Request Payload
  • Click on Submit Icon Execute or Submit Icon to see the response.
  • Once the Web Service request execution is completed, it returns with a response which is also in form of XML nodes.
Web Service Response
Web Service Response
  • In this XML response, you can see the list of cities that are present for the give CountryName, in this example it is for Country: United States.
  • You can now verify if your desired City name is present for the given country, this is how you test manually by viewing the XML response.

There are even options to insert Assertions so that the tool it self will check and let us know if a desired city name is present for the given country, instead of checking manually, this does not need much of coding as it is taken care by SoapUI tool itself. You will learn about this in the subsequent article.

In the mean time we  would suggest you to practise submitting the request for the second method which is “GetWeather” by giving inputs for “City Name”  & “Country Name”.

In case of any queries, please ask us through comments, we would be more than happy to help.

 

Comments (4)

  • Dear Team , Am interested to know if there are any useful links with real time examples to practice and shine in SOAP UI will be good. If so Kndly Share.

    Regards,
    Maruthi.R

    Reply
    • Author

      I would recommend to get started with the link that is shared in the article, let me know once you are done, we can discuss more about it.

      Reply
  • Yeah Srini , I am done with this example, I installed SOAPUI 5.2.1 and fallowed the steps you have give to execute, I am able to execute it. Can you please give more example to use it

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *