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!

SoapUI - Tool for testing web servicesI 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.

Create a New Project in soapUI

This will bring up the new project setup pop-up which looks like this:

New Project in soapUI

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.

  • http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL
  • http://www.webservicex.com/currencyconvertor.asmx?WSDL

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.’

Add the WSDL Details to soapUI New Project

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.

WSDL Added to a new soapUI Project

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.

View Project Properties in soapUI

In the same way, clicking on the Web Service gives you an interface-level view of the WSDL itself.

View WSDL Properties in soapUI

Step #4. Now, how to test the web services in soapUI tool!

Here’s how.

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)

Testing WebServices in soapUI tool

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!

Liked this post?
Sign up now and I will send you more awesome posts like this.
I agree to have my personal information transfered to AWeber ( more information )

Similar Posts

Leave a Reply

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

37 Comments

  1. FYI
    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

  2. Hi Amandeep

    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?

    Best regards

  3. Hi Amandeep,

    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?
    Pls help!!

    Thanks and Regards,
    Ramandeep

  4. Hi,
    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

    1. Hi Pallavi,

      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 🙂

  5. Hi Amandeep,

    I tried with currency convertor wsdl

    I am getting -1 as response. I tried with all values but the result is same -1.

  6. 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?

    1. Hi Krishna,

      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…

  7. Hi Aman,

    Great work…

    Can you please write the whole testing process for any sample WSDL available ? I mean everything, Test cases and results verifications.

    Thanks,

    Maulik

  8. 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.

  9. Hi Amandeep,
    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.

  10. 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?

    Thanks,

  11. Hi Aman,

    Thanks a million!

    Please let us know what more need to be tested, I mean advance level of testing with SOAP UI (sample sites).

    Regards,

    Manoj Lonar

    1. Hi Manoj,

      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.

      Thanks,
      Aman

  12. Wish I saw this post couple of days ago.. could have answered an interview question much better.. but yeah it is a good one..

  13. Getting below response after entering input
    Please can you help ? I am new into this

    soap:Receiver

    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.Stream.Close()
    at System.IO.StreamWriter.Dispose(Boolean disposing)
    at System.IO.TextWriter.Dispose()
    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.SoapServerProtocol.Initialize()
    at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
    — End of inner exception stack trace —