Salve, sto cercando di effettuare il parsing di un messaggio xml ricevuto da un webservice che contiene una stringa json. Quando mi arriva il messaggio viene chiamata la funzione error che mi visualizza: "Error: Type: parseerror". E' necessaria qualche funzione particolare per estrarre una stringa json da xml?
Grazie.
codice:
$.ajax({
url: productServiceUrl,
type: "POST",
timeout: 120000,
dataType: "xml",
data: soapMessage,
complete: endSaveProduct,
error: function( objAJAXRequest, strError ){
$( "h1" ).text(
"Error! Type: " +
strError
);
},
contentType: "text/xml; charset=\"utf-8\""
});
function endSaveProduct(xmlHttpRequest, status)
{
$(xmlHttpRequest.responseXML)
.find('ns:matchResponse')
.each(function()
{
var name = $(this).find('ns:return').text();
$( "h1" ).text(name);
})
}
});