Click here to Skip to main content
14,770,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to a web method to existing webservices...

i have already webservices i added new web method to existing web services
and after add the reference to my project but updated web method didn`t get...

pls help me.........


Make sure the following things:

1. The Newly added web method has the [WebMethod] attribute (This is the most common mistake). Like:

public string HelloWorld() 
    return "Hello World";

2. Make sure your project/web site builds after adding the web mathod.

3. Update the web reference in your client project, that uses the web service.

Hopefully, your problem will be fixed. Best of luck.
amitthakkar1987 20-Aug-10 2:52am
i follow your statement but still i m not getting solution
Al-Farooque Shubho 20-Aug-10 2:54am
OK, then, please post the codes of your web method or, the web service codes. This will be helpful to diagnose the problem.
amitthakkar1987 20-Aug-10 3:02am
find solution
amitthakkar1987 20-Aug-10 3:03am
get the solution
Al-Farooque Shubho 20-Aug-10 3:15am
Good to know :)
Dragonfly_Lee 23-Aug-10 2:44am
then, what's the root cause? Please report the solution just in case other people can get some hints from you.
amitthakkar1987 23-Aug-10 10:24am
just restart application
Try this:
1. Make sure you have given [WebMethod] attribute to the new method added in your web service
2. Build the WebService project
3. Delete the old reference of web-service from your project
4. Re-add the webservice again to your project

Now, check if you get the new method exposed or not. Surely, you should.
amitthakkar1987 20-Aug-10 2:51am
i follow your statement but still i m not getting solution
restart IIS?

The content is too short. Yes, in short, just restart your IIS

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900