Tuesday, October 15, 2013

Create and Perform Web Services Testing through SOAP UI || WSDL Testing in SOAP UI

Create and Perform Web Services Testing through SOAP UI || WSDL Testing in SOAP UI
Create and Perform Web Services Testing through SOAP UI || WSDL Testing in SOAP UI
Create and Perform Web Services Testing through SOAP UI || WSDL Testing in SOAP UI

What is Web Services? Web Services consist of Web Method being called by an application through different protocols like SOAP(Simple Object Access Protocol).To Test these web services we need to convert these web method to XML/WSDL(Web Services Description Language) format.

How to Create a Web Service Application in .Net C#? We need to perform the following steps:

  • Open the Visual Studio VS 2008/2010/2012
  • Navigate to File>>New>>Project
  • In the New Project window choose the .NET Framework 3.5 from the top drop down>>navigate to Installed Templates>>Visual C#>>Web>>ASP.NET Web Service Application 
  • Populate the Solution Name and Location and click on Ok button.
  • Click Ctrl+F5
    Web Service Testing with SOAP UI
    CREATE A WEB SERVICE APPLICATION IN .NET C#
  • The Web Service will look like the following image:
sample web service created in visual studio
SAMPLE WEB SERVICE CREATED IN VS
  • Add the following Code to the Web Method
 [WebMethod]
        public string jointwostg(string firstname,string secondname)
        {
            return System.String.Concat(firstname, secondname);
        }
Web Service Web Method to Add Two strings
WEB SERVICE WEB METHOD TO ADD TWO STRINGS
  • Click on Service Description link or go toAddress bar and add ?WSDL at the end of .asmx file i.e. http://localhost:11561/Service1.asmx?WSDL

sample web service
SAMPLE WEB SERVICE
  • The WSDL XML will look like the following image:

sample wsdl xml
SAMPLE WSDL XML IMAGE
  • Open the SOAPUI application and Navigate to File>>New soapUI Project and Populate the WSDL file address i.e. http://localhost:11561/Service1.asmx?WSDL to Intial WSDL/WADL box and click on OK button

sample web service testing with soapui
SAMPLE WEB SERVICE TESTING WITH SOAPUI
  • Select the Operation jointwostg and press Ctrl+N, At the right hand side Request window gets opened.

Test Case Preparation in SoapUI
TEST CASE PREPARATION IN SOAPUI
  • Delete the ? mark from <tem:firstname>?</tem:firstname> and Populate 'John' and similarly delete the ? mark from <tem:secondname>?</tem:secondname> and Populate ' Benson' and click on Submit request to specified endpoint URL(green button on top). It will show the concatenated string i.e 'John Benson'
WSDL TESTING IN SOAPUI
WSDL TESTING IN SOAPUI
This was just a sample soapui test, we can enhance our testing with different complex webmethods.

How to create a WSDL file from webservice webmethod? If you add ?WSDL at the last of .ASMX(Active Server Method Extension) in the address bar and press the enter key. The WSDL file gets automatically created.

Which is the best book for web services testing with soapui? "Web Services Testing with soapUI" by Charitha Kankanamge(PACKT Publishing)

Create and Perform Web Services Testing through SOAP UI || WSDL Testing in SOAP UI
Create and Perform Web Services Testing through SOAP UI || WSDL Testing in SOAP UI
Create and Perform Web Services Testing through SOAP UI || WSDL Testing in SOAP UI

2 comments:

  1. awesome post on web service testing with the help of soapui. good work buddy.

    ReplyDelete
  2. Cool Man!! This is the best web service testing example with soapui.will appreciate if you add the following information as well:
    1) few more real time example of soapui testing.
    2) interview question on web service testing with soapui.
    3) career and future prospects of web service testing with soapui.
    --Brian

    ReplyDelete