If my WCF web service returns a 500 or 200 http code (soap malfunction message / functional return message)

after reading the SOAP 1.1 specifications, he states that the SOAP error should return an http 500 error code when the link intercepts the http binding, so when a SoapException is thrown, WCF returns an http 500 error code.

Now I'm looking for some recommendations when returning a soap message error message and when returning a SOAP error.

What will you guys return when a functional error occurs while processing a message due to an input message, contains some functional errors, 500 SOAP errors or 200 Soap errors containing some error message?

+3
source share
2 answers

UPDATE:

What would you guys return when a functional error occurred processing the message because the input message contains some functional errors, a 500 SOAP Fault or 200 Soap response containing some error message

If the input message is invalid and does not allow your service to complete its assigned task, then yes - this is clearly an exception, so I would return a SOAP error in this case (something like FaultException<InvalidInputParameters>).

And I would allow WCF to handle all the necessary information about whether or not to return an http error code, if necessary. WCF already does all this for you - you just throw a SOAP error in your service code and all that is for you.

+1
source

Source: https://habr.com/ru/post/1743302/


All Articles