Reputation: 56509
I have started working in ASPX web project, which has already an existing asmx
file. It contains around 4 WebMethods and these 4 Webmethods are showing the http://localhost:2133/WebServices.asmx
Now I tried adding new WebMethod named GetCities
very similar to the existing one, but it is not showing the list in http://localhost:2133/WebServices.asmx
. I tried recompiling it. When I checked deeply (service reference)I couldn't find where the WebService WebServices.asmx
is being referenced.
Existing Method
[WebMethod(EnableSession = true)]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public string GetAvailable(int clientCode)
{
try
{
//Db Querying statements
}
catch (Exception exc)
{
}
}
New method I added
[WebMethod(EnableSession = true)]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public string GetCities()
{
try
{
//Db Querying statements
}
catch (Exception exc)
{
}
}
Totally confused, please share your thoughts.
Upvotes: 3
Views: 5913
Reputation: 149
When you start your project Visual Studio launches "ASP.NET Development Server" to host application. It is not always terminated once you close visual studio, so it may still execute older version of your web service. Try to stop this application or reboot your machine and see if it helps.
Upvotes: 0
Reputation: 34846
You need to update the proxy class that is used to work with your web service by doing the following:
Read How to: Update a Project Web Reference for documentation.
Upvotes: 1