strong-soap icon indicating copy to clipboard operation
strong-soap copied to clipboard

SOAP fault is returned with HTTP status code 200

Open salmipa opened this issue 3 years ago • 2 comments

But it should be 500. See https://www.w3.org/TR/soap12-part2/

StatusCodes

Description/Steps to reproduce

Send back a fault and see yourself.

Link to reproduction sandbox

Expected result

As specified by the specification.

Additional information

Node: win32 x64 16.13.0 [email protected]

salmipa avatar Dec 09 '21 18:12 salmipa

Just debugged it, and noticed that I can change it to 500 by setting

statusCode: 500

but it should happen by default.

salmipa avatar Dec 09 '21 18:12 salmipa

for the record, it is expected to add the statusCode in the fault declaration like this:

 {
	Fault: {
		statusCode: 401,
		faultcode: 'Client.LoginUnauthorized',
		faultstring: 'Authentication failed',
		detail: {
			ExceptionInfo: message
		}
	}
}

I struggled on it and finally found the answer in the code... it would worth adding it to the doc

francois-spectre avatar Jan 30 '24 20:01 francois-spectre