---
title: "WebService Method"  
description: "WebService Method"  
author: "Anonymous User"  
published: 2011-02-17  
updated: 2011-02-17  
canonical: https://www.mindstick.com/forum/166/webservice-method  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# WebService Method

Hi,\
I have created an [ASP.net](https://www.mindstick.com/articles/934/default-folders-available-inside-the-asp-dot-net-application-folder) [web service](https://www.mindstick.com/articles/895/web-service-introduction) that contain a webmethod that return the [string](https://www.mindstick.com/articles/1527/string-split-in-c-sharp).\
Like.\
\

```
[WebMethod]public string sample(){        calculate();        return "This is sample one";}public int calculate(){        return 15;}
```

\
I want to [access](https://www.mindstick.com/articles/12994/how-foreigners-can-access-blocked-websites-in-china) calculate [method](https://www.mindstick.com/forum/156121/how-to-use-http-get-method-http-get-in-agularjs) from [client](https://www.mindstick.com/articles/23198/3-steps-to-ensure-that-your-client-portal-is-impeccable), please let me know how to do it.\
\
Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)!\
\

## Replies

### Reply by Anonymous User

Firstly add [web](https://www.mindstick.com/articles/12783/the-ultimate-bunch-of-free-web-design-resources) reference of this web [service](https://www.mindstick.com/articles/105963/online-thesis-writing-service-for-college-kids-with-disabilities).

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.


---

Original Source: https://www.mindstick.com/forum/166/webservice-method

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
