我有一个网络服务示例http://blahblah:5555/blahblahWS, 何时可以通过在浏览器中输入Web服务端点URL来确认已部署Web服务应用程序,然后查看信息页面。信息页面包含以下信息: {} http://webservice.pli.tc.wssvt.ibm.com RetireWebServices 你好!这是一个Axis2 Web服务!
当我们看到这个时,我们可以确认WebService没问题,那么如何通过jquery $ .ajax调用来确认呢?
我想创建一个显示所有服务及其状态的页面
答案 0 :(得分:3)
使用jQuery.ajax方法的状态代码设置,请看下面的示例。 此示例确认WebService1是否可用,只是提示...
$.ajax({
type: 'POST',
url: "WebService1.asmx/GetItems",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
statusCode: {
404: function () { //404 is for not found
alert('service not found');
},
302 : function () { //302 is for found
alert('service found');
},
500 : function () { //Internal server error
alert('Internal error');
}
}
});
要了解有关HTML代码的更多信息,请访问此网站:http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
上帝保佑。