you can return object, create class like below
public class Results
{
public string Message {get; set;}
public int Value {get; set;}
}
then
[WebMethod]
public Results add( int a, int b)
{
Results res new Results();
if (a > b)
{
res.Message ="a is grater than b";
}
res.Value = a + b;
return res;
}
when you call
localhost.Service1 client = new localhost.Service1();
int a = int.Parse(TextBox1.Text);
int b = int.Parse(TextBox2.Text);
var res = client.add(a, b);
LabelValue.Text = "Add Result : " + res.Value;
LabelMessage.Text = "Add Message : " + res.Message;