Introduction to soapUI Presented by Kushan Athukorala.

12
Introduction to soapUI Presented by Kushan Athukorala

Transcript of Introduction to soapUI Presented by Kushan Athukorala.

Page 1: Introduction to soapUI Presented by Kushan Athukorala.

Introduction to soapUIPresented by Kushan Athukorala

Page 2: Introduction to soapUI Presented by Kushan Athukorala.

2

Agenda

• Feature Overview• Prerequisites• Webservices Examples• First soapUI Project• Examples

Page 3: Introduction to soapUI Presented by Kushan Athukorala.

3

Feature Overview

• Inspecting Web Services• Invoking Web Services • Developing Web Services • Web Services Simulation and Mocking• Functional, Load and Compliance testing of Web

Services

Page 4: Introduction to soapUI Presented by Kushan Athukorala.

4

Prerequisites

• WSDL - basic concepts (services, ports, bindings, port types), relation to xml-schema

• SOAP - basic concepts, relation to WSDL (bindings, etc), different encoding types (soap-encoded/literal) and message styles (document/rpc)

• XML and related technologies - XPath, XML Schema, namespaces, etc

Page 5: Introduction to soapUI Presented by Kushan Athukorala.

5

First soapUI Project

• Step1 - Create or Import a Web Service testing project

• Step2 - Add a WSDL to create tests from• Now that you have a project you can start adding Interfaces

(i.e. Web Service PortTypes) to it.• http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl• http://sdb.amazonaws.com/doc/2009-04-15/AmazonSimpleDB.wsdl

• When you added the interface soapUI created default requests for each operation in accordance with their WSDL and Schema definition

• Step3 - Try some Web Service requests

Page 6: Introduction to soapUI Presented by Kushan Athukorala.

6

Small Note on ASP.Net Webservices

• You use an *.asmx file to create an ASP.NET Web Service.  This file contains your service implementation and is needed for hosting the service.

• ASP.NET automatically generates the WSDL or "service description" for your service by reflecting over the types in your service.  You can see the WSDL for your service by browsing to your ASMX file, which should show you a help page for your service containing a link to the service description for the service. 

• The WSDL can also generally be reached by appending "?wsdl" to the address of the asmx file.

Page 7: Introduction to soapUI Presented by Kushan Athukorala.

7

Example1 – Using TempConvert Webservice

• http://www.w3schools.com/webservices/tempconvert.asmx?WSDL

Page 8: Introduction to soapUI Presented by Kushan Athukorala.

8

Example2 – Couple of Free Webservices

• You can find free web services at following location• http://www.webservicex.net/WCF/Default.aspx

• Try following Web services on soapUI and observer responses

• Currency Converter - http://www.webservicex.net/CurrencyConvertor.asmx?wsdl

• Validate Email Address - http://www.webservicex.net/ValidateEmail.asmx?wsdl

• Airport Information - http://www.webservicex.net/airport.asmx?wsdl• Periodic Table - http://www.webservicex.net/periodictable.asmx?wsdl• Global Weather - http://www.webservicex.net/globalweather.asmx?wsdl

Page 9: Introduction to soapUI Presented by Kushan Athukorala.

9

Getting Started with Functional Testing

• soapUI Functional Tests can be used to develop in general• Unit Tests

• Validate required functionality on each web service invocation on its own

• Integration Tests• Validate required functionality using number of requests

sequence

• Customized Test• Functional Tests can be customised using Groovy Language to

interact with– Databases

or – Perform complex test-flow logic

Note - You will see a better categorization in a later slide

Page 10: Introduction to soapUI Presented by Kushan Athukorala.

10

Design the First soapUI TestCase

• Example - Global Weather Webservicehttp://www.webservicex.net/globalweather.asmx?wsdl

• Step1 - Create a Web Service Test from SOAP request• Step2 - Add an Assertions to a Test

• Click “Add an assertion to this test request” button• Select "Schema Compliance" assertion

– This will check that the response is compliant with the associated WSDL/Schema definition.

• Post the request and validate the response• If all goes well the test-request should be shown with a green background in the

navigation tree• Edit the request and make it invalid and see how it get failed

• Step3 – Run the TestCase using TestCase node

Page 11: Introduction to soapUI Presented by Kushan Athukorala.

11

Thank You

Page 12: Introduction to soapUI Presented by Kushan Athukorala.

12

USA INDIA SRILANKA UK

www.virtusa.com

© V I r t u s a C o r p o r a t i o n

"Virtusa" is a trademark of the company and a registered trademark in the EU and In India. "Productization" is a service mark of the company and a registered service mark in the United States.

"vRule" is a service mark of the company.

For more information please contact [email protected]