Estou consumindo um web service SOAP atraves de uma aplicação mobile com jQuery Mobile onde não consigo converter o valor do response para JSON para manipular as informações.
segue o codigo:
function buscarTodos(){
var webserUrl = “http://localhost:8080/CalculatorApp/ClienteWS?wsdl”;
var soapRequest =
’<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:cal=“http://calculator.me.org/”>soapenv:Header/soapenv:Bodycal:obterTodos/</soapenv:Body></soapenv:Envelope>’;
$.ajax({
type: “POST”,
url: webserUrl,
contentType: "text/xml; charset=“utf-8"”,
processData: false,
dataType: “xml”,
data: soapRequest,
success: SuccessOccur,
error: ErrorOccur
});
}
function SuccessOccur(data, status, req) {
if (status == “success”){
var obj = $.parseJSON(req.responseText);
// $.console.log(req.responseText);
$.each(obj, function( index, value ){
$("#lst_bancos").append(value.nome);
});
}
}