2
我正在使用xml服務來獲得響應,但我從service.please獲得null響應幫助我解決此問題.............jquery ajax發佈問題獲取空值的警報
通過這個服務我發送的用戶名和密碼,但都錯了,正確的是要succeess一部分,因爲我的服務將返回nulll值,但它會在郵差做工精細.........
<script>
function callXMLConnection() {
alert("call Xml method call");
var un=$("#user").val();
var pw=$("#pwd").val();
var myurl="http://192.162.1.153/EServices/retrieve.aspx";
$.support.cors = true;
$.ajax({
data :"",
type: "POST",
url:myurl,
dataType: "xml",
contentType: "application/xml; charset=utf-8",
crossDomain:true,
success: function(data, textStatus, jqXHR){
alert("text : "+data);
},
error: function(jqXHR, textStatus, errorThrown) {
alert("No data found."+jqXHR);
}
});
}
$(document).unbind('pageinit').bind('pageinit', function() {
$("#userInfo").click(function() {
callXMLConnection();
});
});
</script>
這是我的GET身份驗證方法
Private Sub GenerateXMLPostMethod(ByVal Format As String, ByRef iostream As Stream)
Try
Dim WSCOMMAND As String, TMPSTR As String As String
WS_USERID = Page.Request.Item("username")
WSCOMMAND = Page.Request.Item("command")
Select Case WSCOMMAND
Case "get_authentication"
Application_Error("Responded at:" & System.DateTime.Now)
WSCOMMAND = Page.Request.Item("username")
TMPSTR = Page.Request.Item("password")
DeviceID = Page.Request.Item("deviceid")
TMPSTR = Page.Request.Item("command")&"&username"&Page.Request.Item("username") & "&password"&Page.Request.Item("username")
TMPSTR = Page.Request.Item("password") 'Passowrd
LBFN_GET_USER(WSCOMMAND, TMPSTR, iostream)
End Select
Catch ex As Exception
Application_Error("GenerateXMLPostMethod :" + ex.Message)
End Try
你發送的'data'是空白的? –
這是我的服務URL HTTP://localhost/EServices/retrieve.aspx命令= get_authentication與用戶名= 980&密碼= PMS @ 123 ,但我能在阿賈克斯我知道我必須送 「」命令= get_authentication和用戶名發送數據= 980&密碼= PMS @ 123「」 這個數據到ajax,但我可以發送它在XML格式 –