Everyone knows that Soap UI is a very useful tool to test web services both SOAP and REST. but Soap UI is a very useful tool for mock a web service as well. Here is the steps to create a mock web service.
Step 1
Create the new Soap UI project. Version of the Soap UI used is 4.5.1
Select the WSDL file. I have used the schema http://www.webservicex.net/ConvertTemperature.asmx?WSDL
Select the Check boxes - for Create Requests, Create MockService.
Click OK.
Step 2
Select the Operations that we need to mock.
Update the Path which will be the URI for the mocked service.
Update the Port number which will be the port for the mocked service.
Select the check box for Start MockService which will start the mock web service.
Step 4
The Soap UI project structure will be like as follows.
Step 1
Create the new Soap UI project. Version of the Soap UI used is 4.5.1
Select the WSDL file. I have used the schema http://www.webservicex.net/ConvertTemperature.asmx?WSDL
Select the Check boxes - for Create Requests, Create MockService.
Click OK.
Step 2
Select the Operations that we need to mock.
Update the Path which will be the URI for the mocked service.
Update the Port number which will be the port for the mocked service.
Select the check box for Start MockService which will start the mock web service.
Step 3
Specify the name of the mock service to create.
The Soap UI project structure will be like as follows.
Step 5
Update the Response payload as required to consume. This is very useful for unit testing the negative scenarios.
Step 6
Double click on the Mock Web service.(eg. ConvertTemperatureSoap MockService)
Click the Start button and start the mock web service.(also we can start like - Right click on the Mock Service project and Start the mock service )
Step 7
Trigger the request aganist the mock web service uri http://localhost:8088//mockConvertTemperatureSoap and we can see the mocked response as the response for the request.
This is how we can mock a web service easily.... Check it out....






