WEBSERVICE METHOD

Pooja Malohtra

Total Post:47

Points:331
Posted by  Pooja Malohtra
 1492  View(s)
Ratings:
Rate this:
Hi,
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!

  1. Awadhendra Tiwari

    Post:126

    Points:882
    Re: WebService Method

    Firstly 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.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!