Detect parsing error in WCF restful webservices

Thursday, July 10, 2014

In asp.net I have created some web services and used data annotations such as max length, required etc. for request parameter. But when ever wrong input is send while calling web services then it return "Internal Error 500".


I want to get the request parameter in response which has false value.


For e.g.



[Required]
public string Name {get; set;}


When ever name is not supplied in web service, we should get message Name is null or empty.







http://ift.tt/1xXRrpk