Forum Discussion
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.
Ok. Thanks for the post and information, that is very useful information.
The client I am interfacing to, returns fault codes as if they were status codes.
For example:
a 200 is obviously good, but they will return different status codes, based on the quality of the response.
So a 2xx means the data is good, but is expiring soon.
A 2yy means the data is good, but has outstanding claims.
A 2zz means the data is good, but is on hold
(obviously, the xx, yy, and zz stand for numeric values, but I don't have them in front of me right now).
Where most SOAP servers will return a data related status code inside of the data, this particular one ,decided to put their data related status codes as http status codes.
I'll be the first to say I think that is bad programming practice, but that's the situation that I am dealing with.
I was simply trying to make SOAP responses in Soap UI that mimick the data packets that will be coming from the vedor, so that I can put together good ETE testing of all of the conditions that we expect to get.