c# - How to return response from webservice -
i have made web service , clients call methods. suppose 1 method takes 4 parameters , want check if 1 of these empty want send response client , want send alert client knows argument empty. can not force client give parameters accurate. possible?
[webmethod] public void method1(string str1,string str2,string str3,string str4) { if((str1=="") || (str2=="")) { //send response client in form of alert } }
don't reinvent wheel custom objects. @ this msdn article.
the easiest thing throw exception (sounds argumentexception
appropriate in case) , client receive soapexception
.
or throw soapexception
if want more control, such ability set fault code.
Comments
Post a Comment