請告訴我什麼問題的代碼狀態是200好,但無法從Web服務接收記錄(響應)它顯示錯誤null 請幫助我,我嘗試從2天解決它...錯誤代碼jqueryAjax在線webservice
var webMethod = "http://www.w3schools.com/webservices/tempconvert.asmx/CelsiusToFahrenheit?callback=?";
var soap ='<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <CelsiusToFahrenheit xmlns="http://tempuri.org/"> <Celsius>12</Celsius> </CelsiusToFahrenheit> </soap:Body> </soap:Envelope>';
$j.ajax({
type: "POST",
url :webMethod,
data: soap,
dataType :"xml",
contentType:"text/xml; charset=\"utf-8\"",
cache:false,
async: false,
error:function(resp)
{
alert("Error :"+$j.parseXML(resp));
},
}).done(function(response){
console.log(response);
var xmlData =$j(response).find('FahrenheitToCelsiusResult').text();
alert(xmlData);
});
});
這是控制檯 的結果[11:50:33.228] OPTIONS http://www.w3schools.com/webservices/tempconvert.asmx/CelsiusToFahrenheit [HTTP/1.1 200 OK 472ms] – Hamid