81,092
社区成员
发帖
与我相关
我的任务
分享
$.ajax({
url: "http://localhost:8888/TestWebService/services/TestSerivce?WSDL/showTime",
type: "POST",
dataType: "json",
data: "",
beforeSend: function(x) {
x.setRequestHeader("Content-Type", "application/json; charset=utf-8");
},
success: function(json) {
alert(json.d);
},
error: function(x, e) {
alert(11)
alert(x.responseText);
},
complete: function(x) {
alert(22)
alert(x.responseText);
}
});
public interface ITestSerivce {
public String example(String message);
public String showTime();
}
public class TestSerivceImpl implements ITestSerivce {
public String example(String message) {
return "hello worlds!";
}
public String showTime() {
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String time = sdf.format(new java.util.Date());
return time;
}
}