MockService - Web Service Simulator

This section provides a tutorial example on how to create a Web service simulator, MockService, with soapUI 3.0.1, to return a mock response.

In the previous tutorial, I submitted a test request to a real Web service server located at to test my SOAP request.

Can I test my SOAP request without using the real server? The answer is yes. You can use the soapUI MockService function to do this.

1. Continue from the previous tutorial.

2. Right click on "helloBinding" binding in the project object tree and select "Generate MockService". A small dialog box shows up with some default settings:

Operation: Hello
Path: /mockhelloBinding
Port: 8088
Add Endpoint: checked 
   (Adds the MockService endpoint to the mocked Interface)
Start MockService: un-checked

3. Click OK. A new "binding" called "helloBinding MockService" will be displayed in the project object tree.

4. Right click on "Hello" under "helloBinding MockService" and select "New MockResponse". A small dialog box shows up.

5. Enter "Hello_Mock_Response" as the response name and click OK. A test SOAP response will be displayed in a response editor.

6. Enter "Hello from MockService." in the HelloResponse element.

7. Right click on "helloBinding MockService" binding in the project object tree and select "Restart". The interface icon will be animated indicating that mock service is running:
soapUI 3.0.1 Mock Web Service

I think that a Web service simulator is running and accessible at http://localhost:8088/mockhelloBinding now.

Last update: 2009.

Table of Contents

 About This Book

 Introduction to WSDL 2.0

 WSDL 2.0 Document Structure and Syntax

 WSDL Version 2.0 Part 2: Adjuncts

 WSDL 2.0 Document Examples with SOAP Binding

 WSDL 20 Programming APIs and Testing Tools

 Introduction to WSDL 1.1

 WSDL 1.1 Document Structure and Syntax

 WSDL 1.1 Binding Extension for SOAP 1.1

soapUI 3.0.1 - Web Service Testing Tool

 What Is soapUI 3.0.1?

 Downloading and Installing soapUI 3.0.1

 Validating and Inspecting WSDL Documents

 Using Interface Viewer on Bindings

 Generating HTML Documentations On Bindings

 Generating Test Requests on Operations

 Submit Test Requests to the Server

MockService - Web Service Simulator

 Submitting Request to MockService

 Loading Incorrect WSDL Documents

 WSDL 1.1 and SOAP 1.1 Examples - Document and RPC Styles

 PHP SOAP Extension in PHP 5.3.1

 Using WSDL in Perl with SOAP::Lite 0.710

 Using WSDL Document in Java with Axis2 1.4.1

 Using WSDL2Java to Generate Web Service Stub Classes

 WSDL 1.1 Binding Extension for SOAP 1.2

 WSDL 1.1 and SOAP 1.2 Examples - Document and RPC Styles

 SOAP 1.2 Binding - PHP, Java and Perl Clients

 WSDL Related Terminologies


 PDF Printing Version