MockService - Web Service Simulator

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

In the previous tutorial, I submitted a test request to a real Web service server located at http://www.herongyang.com/Service/Hello_SOAP_11.php 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 "Hello_WSDL_11_SOAP" project, and select "New SOAP MockService".

3. Enter "helloBinding MockService" as the name. A new MockService is created.

Name: helloBinding MockService
Path: /
Port: 8088

4. Right-click on "helloBinding MockService, and select "New MockOperation". A small select dialog box shows up.

5. Select "HelloBinding - Hello" and click "OK". A new MockOperation is created with a dummy response.

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 - Create and Run Mock Web Service
SoapUI - Create and Run 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

 Using WSDL Document in Java Apache Axis2/Java for WSDL

 Apache Woden for WSDL Documents in Java

 SoapUI - Web Service Testing Tool

 PHP SOAP Extension for WSDL

 Perl SOAP::Lite for WSDL

 Introduction to WSDL 1.1

 WSDL 1.1 Document Structure and Syntax

 WSDL 1.1 Binding Extension for SOAP 1.1

SoapUI as WSDL 1.1 Testing Tool

 Validating and Inspecting WSDL 1.1 Documents

 Using Interface Viewer on Bindings

 Generating HTML Documentations On Bindings

 Generating SOAP Requests on Operations

 Submit SOAP 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 for WSDL 1.1

 Perl SOAP::Lite for WSDL 1.1

 Apache Axis2/Java for WSDL 1.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

 Outdated Tutorials

 References

 Full Version in PDF/EPUB