NDeveloper
NDeveloper

Reputation: 1847

Input parameters validation and response

I want to validate operation parameters sent from the client (using IParameterInspector) in my service and in case of wrong parameter input I would like to send response code as a part of the response object instead of throwing fault exception. Please let me know how I can achieve this.

UPDATE : If it is not possible with IParameterInspector, what other options you will suggest ?

Upvotes: 0

Views: 318

Answers (2)

Incognito
Incognito

Reputation: 16577

Inspector intercepts calls to service operations and performs logic for validating the parameters passed to that operation. If the parameters are found invalid the actual service operation never gets executed, and the only way to notify client is exception (better be part of FaultContract).

Upvotes: 2

Nario
Nario

Reputation: 551

do you use wcf ? if yes you can use FualtException of Wcf

Upvotes: 0

Related Questions