Home > Internal Server > Jquery Ajax Asmx Internal Server Error

Jquery Ajax Asmx Internal Server Error

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta jquery ajax post 500 internal server error Discuss the workings and policies of this site About Us Learn

500 Internal Server Error When Calling Web Service

more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us request format is unrecognized for url unexpectedly ending Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like failed to load resource: the server responded with a status of 500 (internal server error) you, helping each other. Join them; it only takes a minute: Sign up jQuery: Ajax call to asp.net webservice fails, server return 500 error up vote 3 down vote favorite Ok, so I created a test project just to verify that jQuery AJAX works with asp.net service, and it does no problems. I used a default HelloWorld

Invalid Json Primitive

service created in VS studio. I am calling the service via jQuery like this: in Default.aspx: in TestService.asmx using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; namespace WebServiceTestWitJQuery { ///

/// Summary description for TestService /// [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. [System.Web.Script.Services.ScriptService] public class TestService : System.Web.Services.WebService { [WebMethod] public string HelloWorld() { return "Hello World"; } } } I then proceeded and copied everything exactly as it is in my project and it does not work. I get a 500 server error. I verified following: web.configs identical pages identical service class identical jquery ajax call identical I can navigate to http://localhost:3272/TestService.asmx?op=HelloWorld and webservice works fine. What else? as

here for a quick overview of the site Help Center Detailed answers to any questions fiddler you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community http://stackoverflow.com/questions/2027960/jquery-ajax-call-to-asp-net-webservice-fails-server-return-500-error of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Jquery Ajax Post - internal server 500 error up vote 5 down vote favorite I am trying to post with ajax. but I am getting internal server 500 error. $.ajax({ type: "POST", url: "Services/UserServsice.asmx/UserLogin", http://stackoverflow.com/questions/22038177/jquery-ajax-post-internal-server-500-error data: "{'Username':'" + username + "','Password':'" + password + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (result) { debugger; }, error: function () { } }); the method: namespace Project.Services { [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] [System.Web.Script.Services.ScriptService] public class UserService : System.Web.Services.WebService { [WebMethod(EnableSession = true)] public string UserLogin(string Username, string Password) { if (Username == "yasin" && Password == "123456") { return "true"; } else { return "false"; } } } } What is the problem ? why i am getting the internal server 500 error ? c# jquery asp.net ajax share|improve this question edited Mar 9 at 13:02 Govinda Rajbhar 1,39711537 asked Feb 26 '14 at 10:14 user999822 1701516 You can debug it with your browser, press f12 and see what error it gives. –Kuzgun Feb 26 '14 at 10:19 add a comment| 4 Answers 4 active oldest votes up vote 4 down vote Look at your code url: "Services/UserServsice.asmx/UserLogin", I

Tips/Tricks Top Articles Beginner Articles Technical Blogs Posting/Update Guidelines Article Help Forum Article Competition Submit an article or tip Post your Blog quick http://www.codeproject.com/Questions/458456/unable-to-call-asmx-web-service-through-jquery-aja answersQ&A Ask a Question View Unanswered Questions View All Questions... C# http://www.joe-stevens.com/2010/01/04/using-jquery-to-make-ajax-calls-to-an-asmx-web-service-using-asp-net/ questions Linux questions ASP.NET questions SQL questions fabric questions discussionsforums All Message Boards... Application Lifecycle> Running a Business Sales / Marketing Collaboration / Beta Testing Work Issues Design and Architecture ASP.NET JavaScript C / C++ / MFC> ATL / WTL / STL Managed C++/CLI C# internal server Free Tools Objective-C and Swift Database Hardware & Devices> System Admin Hosting and Servers Java .NET Framework Android iOS Mobile SharePoint Silverlight / WPF Visual Basic Web Development Site Bugs / Suggestions Spam and Abuse Watch features Competitions News The Insider Newsletter The Daily Build Newsletter Newsletter archive Surveys Product Showcase Research Library CodeProject Stuff communitylounge Who's internal server error Who Most Valuable Professionals The Lounge   The Insider News The Weird & The Wonderful The Soapbox Press Releases Non-English Language > General Indian Topics General Chinese Topics help What is 'CodeProject'? General FAQ Ask a Question Bugs and Suggestions Article Help Forum Site Map Advertise with us About our Advertising Employment Opportunities About Us Ask a Question All Questions All Unanswered FAQ unable to call asmx web service through jquery ajax Rate this: Please Sign up or sign in to vote. See more: C# ASP.NET jQuery web.Config i created a asmx web service and running on localhost:5739 and created a html page out side of the port and trying to call web service from jquery. i am always it is going in to onError function and displaying undefind; asmx web sercie is //

/// Summary description for testservice /// [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. [S

for Marketers Send Email with Username and Password March 23, 2015 Fix TeamCity failing to clone or pull from Git January 13, 2015 Categories Ajax (9) ASP.NET (42) C# (54) Continuous Integration (1) IoC (1) JavaScript (17) Jenkins (1) jQuery (13) Linq (13) Misc (1) MongoDB (5) MVC (18) Personal (11) Silverlight (9) Sitecore (7) TeamCity (1) Visual Studio 2008 (3) WCF (5) Xbox 360 (1) XML (1) Download source Making ajax calls to an ASP.NET web service using jQuery is too easy.  In this post I'll explain how to do it! Start by creating a new web project and adding a new ASMX web service: Open the new web service and uncomment the following line to allow the web service to be called from script. [System.Web.Script.Services.ScriptService] The web service should already have a method called HelloWorld; first I will use jQuery to call this method.  Create a new page and add a reference to the jQuery library.  Add a button and a label to the form; when the button is clicked I will call the web service and display the result in the label.  My form looks like this:

   
                    You can see I've set the OnClientClick property of the button to call a JavaScript function called CallService which I will implement in a moment. I have set the text of my label to a non breaking space and set the width to 100%. This is because I will add a CSS class to the label while calling my web service to show an ajax loader.  Here is the CSS class: .loading {  background-image: url('ajax-loader.gif');  background-repeat: no-repeat; } Finally I need to add the jQuery: