纯HTML加JS要怎么调用webservice-CSDN论坛

如题所述

第1个回答  2017-10-25
//转化为JSON对象
function jsonTest(){
    var pConnection = new Ext.data.Connection({timeout:1200000});
    pConnection.request({
        method: 'POST',
        url: path + '/testAction.do?method=jsonTest',//换成你的WEBSERVICE WSDL
        params: null,
        success: function(response, options)
        {    
            alert(response.responseText);
            var jsonData = Ext.util.JSON.decode(response.responseText);
            alert(jsonData.aa);
        },
        failure: function(response, options)
        {
            alert("big fail!");
        }
    });
}

本回答被提问者采纳
相似回答