Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
Call webservice using JQuery reflect 404 error
Ajay Patel
Apr 22 2014 3:13 AM
806
Reply
Hello,
I am facing a strange problem. I have webservice that is running pretty good on its url. I am consuming it using jQuery and all methods are working fine but one method throw error of 404 with readystate 4. I have checked the url and it is correct. I don't know why this is happening.
This is my Code :
$.ajax({
type: 'POST',
cache: false,
url: "http://ajayp/WebService2.8/XYZasmx/GetXYZ",
contentType: 'application/json; charset=utf-8',
data: "{ReportID: '" + RptNR + "'}",
dataType: 'json',
success: function (e) {
if (e.d != null) {
SetFields(JSON.parse(e.d));
}
else {
alert("Invalid Case Number");
}
},
error: function (e) {
alert(e.responseJSON);
},
fail: function (e) {
debugger;
}
});
My VB Code :
<WebMethod()> _
<System.Web.Script.Services.ScriptMethod(ResponseFormat:=System.Web.Script.Services.ResponseFormat.Json)>
Public Function GetRacialProfilingDataByReportID(ByVal ReportID As String) As String
Try
Return "Ajay Patel"
Catch ex As Exception
Throw ex
End Try
End Function
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
Asp.Net Java Script COde For Jquery Calender
how to add a close button to a menu item using jquery