tags:

views:

253

answers:

1

Hi all,

after reading the SOAP 1.1 specs, it states that a SOAP Fault should return a http 500 errorcode when communication goes over a http binding, so when a SoapException is thrown, WCF returns a http 500 error code.

Now, I'm looking for some best practices to when return a functional soap error message and when to return a SOAP Fault.

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

A: 

UPDATE:

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

If the input message is invalid and prevents your service from doing its intended job, then yes - this clearly constitutes an exception, so I would return a SOAP fault in this case (something like FaultException<InvalidInputParameters>).

And I would let WCF handle all the necessary gory details of whether or not and when to return what http error code, if necessary. WCF already does all of that for you - you just throw a SOAP fault in your service code and that's all there is for you.

marc_s
SOAP-based service calls don't typically return HTTP result codes--> they also return http codes, since it's just a HTTP post
Tim Mahy
@Tim Mahy: I **highly** doubt a SOAP call on a netTcpBinding in WCF is a "http post".....
marc_s
@Tim Mahy: I'm still convinced you're confusing two things here: SOAP calls are **not** http posts - they can travel over http, granted - but also over TCP/IP native, UDP - any transport. WCF REST calls are HTTP posts and gets - but there's no SOAP involved in those REST calls at all....
marc_s
ow sorry, I forgot about the non http bindings, I will edit my question....
Tim Mahy