hooklift / gowsdl

WSDL2Go code generation as well as its SOAP proxy
Mozilla Public License 2.0
1.14k stars 390 forks source link

Added better error/fault handling according to SOAP Spec 6.2 #252

Closed kkoehler closed 1 year ago

kkoehler commented 1 year ago

According to the SOAP Spec (https://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383529), faults are retunred with HTTP 500 statusCode.


In case of a SOAP error while processing the request, the SOAP HTTP server MUST issue an HTTP 500 "Internal Server Error" response and include a SOAP message in the response containing a SOAP Fault element (see section 4.4) indicating the SOAP processing error.

The current implementation doesn't handle 500 that way. It returns HTTPError objects instead.

The PR adjusts this behavior so that 500er HTTP responses are checked if there is a fault or not and returns the right object/error accordingly.

Credits also to @derblum

Thanks, Kristian

c4milo commented 1 year ago

LGTM! Thanks @kkoehler!