Forum Discussion
You mentioned that you created a 'fault' which makes me think you might have a SOAP mockservice?
Status Code is not used in SOAP. It will only be an option for mock responses in a REST service.
Yes, in the mock service, when I create a response, it allows me to create a normal response or a fault response.
My question is, how do I specify which type of fault that is, there are dozens of fault types. According to the documentation, there is supposed to be an option in the fault window to specify which fault type you want. But it's not there. I am current on my install of SOAP UI.
You can only specify the status code for a REST mockservice. See attached. (It should be blue, not green)
So is there no way to mock a speciifc status code for SOAP? I'm interfacing with a vendor that uses SOAP, and I want to set up negative tests to be sure I handle them properly.
SOAP specification doesn't allow for status codes.
When the server returns a SOAP fault:
For SOAP 1.1, the status code must be 500 “Internal Server Error”.
For SOAP 1.2, it varies based on the type of the SOAP fault.
For env:Sender, the status code is 400 “Bad Request”,
but for anything else it is 500 like SOAP 1.1.(https://blogs.msdn.microsoft.com/nathana/2011/03/31/deciphering-a-soap-fault-with-a-400-status-code/)
Your SOAP version should be automatically detected from your WSDL. You can also change the SOAP version at the Binding level in your project.