У меня есть существующее решение .net, которое использует проверку подлинности Windows.Теперь я добавил еще один проект для Web-сервиса в существующее решение и создал там сервис .asmx.Через ajax я пытаюсь вызвать этот веб-сервис, как показано ниже:
Ajax запрос
$.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")
}
});
, и вот мой сервис .asmx
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";
}
}
}
В приведенном выше коде, я получаю ошибку как No web service found at: /HelloService/HelloData.asmx.
в файле «Global.asax.cs» в методе «Application_error».Что здесь не так и что нужно сделать?