Passing Validation exceptions via WCF REST

Posted by Coppermill on Stack Overflow See other posts from Stack Overflow or by Coppermill
Published on 2010-03-23T16:52:38Z Indexed on 2010/03/23 16:53 UTC
Read the original article Hit count: 371

Filed under:
|
|
|

I am using WCF and REST, and I have complex types, which are working fine. Now I need to check for validation, I am thinking of using DataAnnotations e.g.

public class Customer
{
   [Required]
   public string FirstName {get;set;}
}

Now where the issue is how do I pass this validation down to the REST service?

ALso I need to validate the object when it comes back, and throw an exception, if I am to throw an exception then what is the best way of doing this using REST?

© Stack Overflow or respective owner

Related posts about wcf

Related posts about rest