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