What is SoapUI?
SoapUI is a widely used tool to test web services. The use is not restricted to developers. QA teams can create automated test suites, plugin the tool with Spreadsheets to consume test data and prepare test reports through a report API and can send the report through email to an emailing list. Moreover SoapUI comes in open source flavor, you can do a lot more customization suiting your needs. This is a “SOAP UI – Testing Web Services – How to” guide and deals with setting up Soap UI to start testing soap based Web Service.
In this “How to” starter post, I would like to introduce you to the world of web services testing through soapUI. I would personally not like to overwhelm you with an overdose of information, we will do it in later posts !!. Please follow me through the steps if you would like to make the most of this powerful utility. Its fairly easy to get started.
Where to download SoapUI?
The free version of SoapUI (the one I recommend) can be downloaded from here.
If you are on a Mac/Windows install the downloaded dmg/exe, as the case may be.
Then hit the SoapUI icon, which will bring up the tool to life. Now we are all set to create our first SoapUI project to get started with simple testing.
Steps to work with SoapUI project
Step#1: In the first step you need to create a project. From the File Menu, Select “New SOAP Project”. You need to name your project, say – MyFirstProject.
Step#2: Now you need to give the tool the Initial WSDL information. WSDL basically stands for Web Services description Language and it defines a web service through information like end points, Operations, Parameters etc. As per wikipedia.
The Web Services Description Language (WSDL pronounced “wiz’-dul”) is an XML-based interface definition language that is used for describing the functionality offered by a web service. The acronym is also used for any specific WSDL description of a web service (also referred to as aWSDL file), which provides a machine-readable description of how the service can be called, what parameters it expects, and what data structures it returns.
Step#3: If you are working on a project and have the wsdl available with you, browse to the location to select it. If you don’t have a wsdl file available with you don’t worry, follow the next steps to test public services.
Step#4: If you want to test an available public webservice and don’t have any wsdl, I would recommend you to search for any exposed service to public. Here we will try http://www.service-repository.com/, this website has a few web services which are exposed to public. Navigate to one of the services and copy the url of the corresponding wsdl. I am selecting weather service and the url for the wsdl is http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL. Paste this in the Initial wsdl textbox that you see prompted. Keep other options at default and hit OK.
Step#5: A Soap based web service has operations associated with it. Once you hit Ok in the above step, towards the left side area of the tool you will see various operations listed for you-
GetCityForecastByZIP is one such operation we will use here. An operation determines the kind of function the web service will perform. Here the operation is supposed return City weather forecast information.
Step#6: Now under the operation you fill find sample request, just open it up, you will find an xml request message automatically created for you. What you need to do now is fill up the “? “ with valid data. For zipCode, I will use 10001 which is the zip code of New York.
Step#7: Now after filling the data, hit the green arrow at the top left of the request dialog box.
Step#8: Now you will see a response in the right side of request dialog box, which is the response from the web service – Weather service to be precise !!
Free wsdl url to start testing with SoapUI
For beginners to learn SoapUI I am providing a few web services wsdl available in public domain. You won’t need an authentication mechanism for consuming these web services. To learn more you can use – SoapUI setup – getting started with SoapUI.
List of available web services wsdl in public domain
This website has a few common services listed. Below are the wsdl files. You can get sample request, responses in the website itself.
The below is a listing from service-repository.com. You can check out more from the website itself. They keep a regular tab on the status of the web service availability. You can also find the actual description and function of the web service in detail.
Now since you are getting the response, your setup is complete. Now you can use this tool to do assertions, fudge with the request and response and do a hell lot of other things. A few things you can do with SoapUI are – Integration with other API, tools, apps, automations,reporting, create test suites, load testing, stress testing etc. I will write on these items in subsequent posts. Feel free to ask questions. If you like the post and join us, please subscribe to our newsletter.