Pode postar seu código aspx? Ocorre algum erro na chamada?
Está fazendo a chamada assim:
$.ajax({
type: "POST",
url: "../MathService.asmx/GetFullName",
data: "{'name':'"+ name + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: SuccessCallBack,
error: FailureCallBack
});
Lembrando que o nome do método que será chamado deve ser informado na URL do web service - "GetFullName"
Outro problema muito comum na chamada de WebService via script é o atributo
ScriptService
do WebMethod, deve ser descomentado:
[...]
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// 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 MathService : System.Web.Services.WebService {
public MathService () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string GetFullName(string name)
{
return "[Webservice response]\n\nYou have entered : " + name ;
}
}
Podem ser muitas coisas o problema, se puder informar mais detalhes talvez eu possa ajudar. :)
Rodrigo Reis Ferreira
Microsoft Certified