日期:2014-05-17  浏览次数:20594 次

通过jquery ajax调用webservice服务没有反应
<script type="text/javascript">
$(function(){ 
$('#weatherBtn').click(function() {
        var wsUrl = "http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx";
var soap = '<?xml version="1.0" encoding="utf-8"?><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><getWeather xmlns="http://WebXml.com.cn/"><theCityCode>南昌</theCityCode><theUserID></theUserID></getWeather></soap:Body></soap:Envelope>';
$ajax({
url:wsUrl,
type:'POST',
dataType:'xml',
data:soap,
success:function(){
alert('success');
},
error:function() {
alert('error');
}
});
    });
}); 

</script>
ajax webservice

------解决方案--------------------
 $ajax这里  $.ajax