How to return http 500 using soapUI

I am mocking my web service using soapUI. Now I also want to check the error. To do this, the service layout (= soapUI) should return HTTP 500. Does anyone know how soapUI can do this?

thanks

+4
source share
3 answers

This can be achieved with the following Groovy code:

mockRequest.getHttpResponse().sendError(500) 
+6
source
  • Create a service layout.
  • Create a new mock answer.
  • Open the answer layout editor (double-clicking it) and click on the exclamation mark symbol that creates the SOAP Fault response.

If you look at the response RAW code, you will see error code 500. (Internal HTTP / 1.1 500 server error)

Btw, if you created two reponses, successful and the error response, and then when using the mock service SOAPUI alternates between the two answers.

+3
source

Right-click on MockResponse> Show MockResponse Editor. Look at the properties of MockResponse on the left side, at the bottom Scroll down the page to find the "HTTP response status", edit the value to 500.

+2
source

All Articles