I have created an ASP.net web service that contain a webmethod that return the string.
Like.
[WebMethod]
public string sample()
{
calculate();
return "This is sample one";
}
public int calculate()
{
return 15;
}
I want to access calculate method from client, please let me know how to do it.
Thanks in advance!
Anonymous User
17-Feb-2011Firstly add web reference of this web service.
Then create an object of this web service. When you create an object of this web service then web method sample () is accessible and you can call this method to get output.
We can directly call calculate () method inside web method sample.
Please check this link.
http://www.mindstick.com/Articles/f784d86d-a6a2-4cd8-a085-43c9310e94ad/?Inserting Records in Table by Using Web Services
This might be helpful.