请告诉我什么问题的代码状态是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