-2
我收到{error:請使用post request}。這裏是我試過的代碼:在html中使用java腳本代碼以消耗java中的webservices
$(document).ready(function() {
$("#btn").click(function (event) {
var uid = document.getElementById("fpsid").value;
var pwd = document.getElementById("Pass").value;
var dataString = "{ 'fpsid' : '" + uid + "', 'Pass' : '" + pwd + "'}";
$.ajax({
ServiceCallID: 1,
url: "http://epds.nic.in/PossWebService/services/Poss?wsdl",
type: 'POST',
data: dataString,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) {
returnVal = result.d;
alert(returnVal);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
returnVal = '';
}
});
});
});
編輯爲您的文章。這不屬於評論。 –
你有js小提琴嗎? – Konza
什麼是'ServiceCallID'應該是? – jasonscript