读书人

经过jquery ajax调用webservice服务没

发布时间: 2013-12-02 12:00:40 作者: rapoo

通过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

读书人网 >Java Web开发

热点推荐