I have a Wcf Rest service
[OperationContract]
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
void Import(stringrequest);
My try code:
public void Import(string request)
{
if (request != null)
{
//....
}
else
{
throw new ApplicationException("Empty DATA");
}
}
In fact, I want to display a specific error message on the else treatment,when I test my wcf srevice in POSTMAN , if I enter a empty string ---> My objectif to display "Empty DATA",
How can do that? Thanks,