ProductivityAndFun Download Trial - Free 14 day evaluation

Mock Services - 3) Invoking a MockService

PDF Print E-mail
User Rating:  / 71
Rate this article: PoorBest 

3) Invoking a MockService

  1. First we must start the MockService. Click the Start button in the MockService editor, run, this will start the service on the configured port and path.
    Started MockService
    To the Top Right of the Editor you should see that it's running, and the port it's responding on. The play Button is greyed out and if you would like to stop the MockService, just click the stop button.
  2. In the MockResponse editor, Click the Button Create Request.
    Create Request for Mock
  3. This will prompt you to to open one of the existing requests for its operation in your project.
    Create_New_Request
  4. You will also need to give it a name
    Open_Request
  5. When you open the request, soapUI will automatically change its endpoint to the endpoint of the locally running MockService instead of the endpoint that the WSDL is using. Submit the opened request by clicking the Run Button.
    Sent Request with MockResponse
    As you can see the MockService returned the values we entered earlier as the response.
  6. If you switch back to the MockResponse editor and select its Incoming Request view, you should be able to see the request that was posted to the MockService and handled by the MockOperation.
    response_with_request

Congratulations! This was your first MockService. Admittedly it was quite simple, so lets make it a bit more sophisticated. But first, feel free to modify the created MockResponse content and re-submit the request to see that your changes are instantly available, there is no need to restart the MockService. Done? Let's move on and finish by customizing the MockResponse.

 


Go to Article Page: Go to Previous Page 1 2 3 4 5 Go to Next Page