I'm trying to access the Login method of a certain webservice, but instead of returning the .Token that I ask in the reply, I get a pure webservice HTML
My js code:
$.ajax({
crossDomain: "true",
//contentType: "text/xml",
//type: "POST",
url: "http://macchips.macpontoweb.com.br/wsvisita/services/comum/autenticacao/autenticacaosrv.svc?Login",
data: {
usuario: client.value,
senha: senha.value,
},
success: function(resposta){
alert(resposta.Token);
},
error: function(error){
var falha = JSON.stringify(error);
alert("Erro " + falha);
}
});
The type and contentType lines are commented out. I think I need them but I do not know for sure.
I'm trying to access the webservice via an application I'm developing
///// EDIT ///////
I made some changes, now I'm getting a readyState: 4, status: 200, statusText: load
My code changed:
$.ajax({
type: "POST",
crossDomain: "true",
dataType: "jsonp",
contentType: "text/xml",
url: "http://macchips.macpontoweb.com.br/WSVisita/Services/Comum/Autenticacao/AutenticacaoSrv.svc",
data: {
Login: 'wellington, wellington'
},
success: function(resposta){
window.location.href="login.html";
alert(resposta);
},
error: function(jqxhr, error){
var falha = JSON.stringify(error);
alert("Erro " + falha);
}
});