If you are working on SOA-based projects, you won’t deny the fact that testing web services can sometimes drive you crazy and when you are on the testing side, the effect is even more!
I have been testing end-to-end web applications for a long time, and web services have always been an integral part of the systems I have tested.
Testing web services had been a daunting process till I stumbled upon soapUI tool for web service testing over a year ago.
The proof of how easy and useful I find it to use is the fact that I utilise it every day (of course, only on the days when I work ;)).
soapUI (by Smartbear) is a great tool to test and demo REST/WADL and SOAP/WSDL-based web services.
In this quick tutorial, I will show you how to test web services in soapUI tool.
Let’s get started.
Step #1. First of all, download soapUI and create a new project!
Follow the path: File >> New soapUI Project or just click anywhere in soapUI tool and use ‘Ctrl+N’ to create a new project.
This will bring up the new project setup pop-up which looks like this:
Step #2. Now, name the project and point it to a valid WSDL/WADL. In this tutorial, I am calling the project as “QST soapUI Tutorial” and pointing it to the sample WSDL file provided by soapUI team.
For your convenience, I have given 2 sample WSDL URLs below. You can run either of these to get started with soapUI.
For more free sample WSDL URLs for web services, check this post.
Once your ‘New Project’ window looks as shown in the screen grab below, click on ‘OK.’
Now, at this point, you might have a question, “Why do I need to import a WSDL?” Well, mostly the soapUI projects are based on WSDL however, it is not compulsory to import a WSDL to test a web service.
Then, why the hassle?
The advantage of using a WSDL is, it contains all the crucial information about the web service to be tested – Sample Request and Response, Web Service contents and much more.
WSDLs make your life much easier, especially when you are just getting started with testing web services. To get started, I recommend getting the WSDL files – your project developers/web service architects should be able to help to get them!
Step #3. Based on the WSDL source you use, soapUI will load the related definitions and configuration and will show up the operations in the Web Service. If you have followed the steps correctly, below is how the navigator looks.
You can double-click on the project name in the navigator to see the overview of any project and related details. As you become an advanced user of soapUI, this window provides some valuable information which you would need going forward.
In the same way, clicking on the Web Service gives you an interface-level view of the WSDL itself.
Step #4. Now, how to test the web services in soapUI tool!
With all the interface operations shown in the WSDL navigator screen, navigate to the service request in the test layout tree and double-click on the Request. This will open up a stubbed request and response with comments to help you fill it up.
Fill the mandatory field tags and click on the Run (Play) button.
In the below example, I have simply added the values in the request for currency conversion, and once I click on the green Play (Run) button, it brings back the response from the server, which will show in the right section in the below image. (Click image to enlarge)
The Request/Response are by default set to XML format. You can click on ‘Raw’ tab in either Request or Response to get a full view of the HTTP request made to the server, and the response returned.
Over to you!
This is how you use soapUI for web services testing!
I hope you find this introductory tutorial to soapUI testing tool helpful. Do give soapUI a try and if at all you stumble upon any issues, let me know in the comments below.
If you think this tutorial about soapUI web services testing could help your colleagues and friends, please do tweet it and share it on facebook.
Till then, happy testing!
I’m working for many years on testing the system that include different web services and several versions of the system that have several generation of the products with multiple versions
Have been enjoying working with SonarSonar for many years for very large projects where have to run thousands of functional/regression tests (most data-driven)
SoapSonar is powerful, very user friendly tool that allows to run very large scale projects
SOAP UI is not even suitable to run large test suites with DM libraries using Grid due to memory issue
Because of the design set up test preconditions are challenging for large scale projects and include setting up Global Variables, Preferences, Custom Properties, Environments, etc. in different tool modules
If i want diagram from you about SOAP UI ?
What diagram are you after Nget?
Thank you so much for this clear explanation
I am a master student and master thesis will be comparing some nonfunctional requirements of SOA service VS. REST service.
so my question: is SOAPUI tool suitable and enough for me to do that?
Yes, I think you can!
You could also check PostMan for this. Whatever you do and how it goes, I would be interested to know 🙂
I want to do load testing using Soap UI and for that i need to fetch data from excel sheet. How can i fetch data from the sheet?
Thanks and Regards,
Hi Raman – I haven’t tried this myself but I think this could help you…
I get this error
Unknown host: http://www.webservicex.com
No additional details available
How to fix this
My request takes an xml attachment. I would like to pass the attachment (or) the contents of the attachment directly in the request and avoid adding the xml file to the attachments tab.
Any ideas on how to do this
First of all, apologies for the delay in replying to your query.
Attachments in soapUI are managed in the attachments tab at the bottom of the request editor. You can attach the file you want to send here and make a reference to it using the cid: notation. You can more details here.
Please do let me know in case of further queries and how it goes… so if this works for you, do reply here 🙂
I tried with currency convertor wsdl
I am getting -1 as response. I tried with all values but the result is same -1.
Hi Vivek, I think the WSDL service was down when you tried this – are you still facing the same issue?
Very useful information. Explained in very simple steps.
Thanks a ton.
thanks aman Please provide more articles on Soapui
Thanks a Lot!
I am new in soapui ,i have a 4+experience in selenium +java frame works .
how can i integrate groovy script with soapui functional test ?
please guide to step by step groovy code
Thanks and regards
Hi Raji –
I think this resource could be helpful.
Hello I have a big doubt. How the soapUI importing wsdl and working properly without creating a java proxy file .
Can we do the same thing without using automatically generated java proxy file in eclipse.
If yes then how?
I am not an avid user of eclipse at the moment and not too sure about this one… I would recommend posting your query on Eclipse forums at help.eclipse.org
I hope this helps… apologies I couldn’t help more in this instance…
Can you please write the whole testing process for any sample WSDL available ? I mean everything, Test cases and results verifications.
Sure Maulik, I can plan this in one of my upcoming articles…!
New knowledge for me also helped me in my work.
I have used SOAPui to create and test a REST call with authorization headers and json data. It works. How can I now see the http uri that is being sent to the REST service? I have to plug that url into a “response url” field to execute when a certain event occurs.
Good work Aman .. 🙂
Thanks Sir! 🙂
I want to get the response in the same manner of request. For example, if am performing an create operation by entering values within the tags and run the file for a successful creation then, i need a response in the same way. It will be helpful if you could guide me through the steps.
This is a great tutorial. Thanks!!!
I have a few doubts regarding using Soap UI. Can we use it for test on any web page. Suppose I want to test (using soap UI) successful login with valid user name and password in say facebook.
Can this be done? Where is WSDL file for this?
@Nikhil and @Raghu :
for currency ocnverter, try using the following WSDL –
@Aman – thanks praji. good one for beginners.
Thanks a million!
Please let us know what more need to be tested, I mean advance level of testing with SOAP UI (sample sites).
I do plan to write about this with sample WSDLs in the near future. Please subscribe to my newsletter to keep you updated with once the post is published.
Wish I saw this post couple of days ago.. could have answered an interview question much better.. but yeah it is a good one..
Aha… someone looking for a change. Well, good luck! 😉
Thanks for your comment, Pavithtra. You can bookmark it now for future references 🙂
I’m also getting same error like Nikhil
How can we test a website without having its WSDL file?
Please help me, I want to test a website without using WSDL.
Please can you elaborate more? soapUI is for testing webservices and for this you will need a WSDL file
Getting below response after entering input
Please can you help ? I am new into this
System.Web.Services.Protocols.SoapException: Server was unable to process request. —> System.IO.IOException: There is not enough space on the disk.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.WriteCore(Byte buffer, Int32 offset, Int32 count)
at System.IO.FileStream.FlushWrite(Boolean calledFromFinalizer)
at System.IO.FileStream.Dispose(Boolean disposing)
at System.IO.StreamWriter.Dispose(Boolean disposing)
at Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String sources)
at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters options, String sources)
at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromSource(CompilerParameters options, String sources)
at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping xmlMappings, Type types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping xmlMappings, Type types, String defaultNamespace, String location, Evidence evidence)
at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping mappings, Type type)
at System.Web.Services.Protocols.SoapServerType..ctor(Type type, WebServiceProtocols protocolsSupported)
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
— End of inner exception stack trace —
Which WSDL are you trying to hit Nikhil?