WSDL Tutorials - Herong's Tutorial Examples - Version 2.10, by Dr. Herong Yang
Outdated: SoapUI 3.0.1 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 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 "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:
I think that a Web service simulator is running and accessible at http://localhost:8088/mockhelloBinding now.
Last update: 2009.
Table of Contents