I have an existing .net solution which uses windows authentication. Now i added another project for Web-service in existing solution and created a .asmx service there. Through ajax i am trying to call that web-service as below
Ajax request
$.ajax({
type: "POST",
url: "HelloService/HelloData.asmx/HelloWorld",
data: "{parameterList:" + JSON.stringify(model) + "}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
success: function (jsondata) {
alert(jsondata);
}, error: function (x, e) {
alert("Error")
}
});
and here is my .asmx service
namespace HelloService
{
/// <summary>
/// Summary description for HelloData
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class HelloData : System.Web.Services.WebService
{
[WebMethod]
public string HelloWorld(string parameterList)
{
return "Hello World";
}
}
}
In the above code, i am getting error as No web service found at: /HelloService/HelloData.asmx.
in "Global.asax.cs" file in "Application_error" method. What's wrong here and what needs to be done?