Method Error 12030 Ajax
question and get tips & solutions from a community of 418,589 IT Pros & Developers. It's quick & easy. AJAX + Webserivces = error 12030 P: n/a kpg I have an AJAX enabled web service consumed by an AJAX enabled web app, given a zip code it returns the city and state. Tested the web service, it works fine. I created a services collection in the script manager and pointed to my web service. I call the web service from an html input button click, per MS examples. I get a 12030 error. Now it seems the web service must be in the same domain as the web app, while this is a severe limitation I figured this was the problem. So I created the web service on my localhost, I get the same error. I played around with page methods but kept getting object not defined errors so I gave up on that. (It seems the web method must be declared in the aspx file, but I still get this error.) Considering that the same domain limitation was enough to make the whole effort pointless (the web service will NOT be in the same domain as the web app) I thought I would go the traditional route and use xmlhttprequest. I've used It before in asp.net 1.1 and it worked well. So I copy my working code from a 1.1 app, change the url to point to my Web service, invoke it and get access denied. Why access denied? No doubt it's MS protecting me from myself again. Here's the code: I'm using ?wsdl just to get some xml back for testing. function Button1_onclick() { debugger; var url = 'http://localhost/webServices/ZipCode/ZipCodeService.asmx? wsdl'; // branch for native XMLHttpRequest object if (window.XMLHttpRequest) { req = new XMLHttpRequest(); req.onreadystatechange = onComplete; req.open("POST", url, true); req.send(null); // branch for IE/Windows ActiveX version } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); if (req) { req.onreadystatechange = onComplete; req.open("POST", url, true); req.send(); } } } function onComplete(arg,usercontent) { debugger; if (req.readyState == 4) { if (req.status == 200) { // ...processing statements go here... } else { window.status="There was a problem retrieving the XML data:" + req.statusText; } } } Alternately I would love to use ASP.AJAX features to do this the 'right' way, but that 12030 error occurs no mat
for a quick overview of the site Help Center Detailed answers to any questions 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 Code Review Questions Tags Users Badges Unanswered Ask Question _ Code Review Stack Exchange is a question and answer site for peer programmer code reviews. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are https://bytes.com/topic/asp-net/answers/683921-ajax-webserivces-error-12030-a voted up and rise to the top Ajax Object - 12030 Loop Fix? up vote 2 down vote favorite Here are 3 methods which handle my ajax calls. I loop until pass b.c. I've had problems with the Ajax Object working as expected. This is noted here /** * Ajax */ var Ajax = ( function () { var Ajax = function (element) { this.object = this.create(); }; http://codereview.stackexchange.com/questions/7776/ajax-object-12030-loop-fix Ajax.prototype.create = function() { var request; try { request = new window.XMLHttpRequest(); } catch( error ) { try { request = new window.ActiveXObject( "Msxml2.XMLHTTP" ); } catch( error ) { try { request = new window.ActiveXObject( "Microsoft.XMLHTTP" ); } catch( error ) { request = false; } } } return request; }; Ajax.prototype.use = function( param, ajax_func ) { var GATEWAY = 'class.ControlEntry.php'; var self = this; this.object.open( "POST", GATEWAY, true ); this.object.setRequestHeader( "Content-type", "application/x-www-form-urlencoded" ); this.object.setRequestHeader( "Content-length", param.length ); this.object.setRequestHeader( "Connection", "close" ); this.object.onreadystatechange = function() { if( this.readyState === 4 ) { if( this.status === 200 ) { ajax_func( this.responseText ); return true; } else { self.invoke( param, ajax_func ); return false; } } }; this.object.send( param ); return true; }; Ajax.prototype.invoke = function( param, ajax_func ) { var state = false, count = 1; while( state === false && count <= 5 ) { if( count !== 1 ) { alert( 'Ajax Object Use Failed | Try Again '); } state = this.use( param, ajax_func ); count++; } return state; }; return Ajax; } () ); javascript share|improve this question edited Apr 18 '12 at 18:42 asked Jan 13 '12 at 16:47 user7459 What's your question? –seand
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 answersQ&A Ask a Question http://www.codeproject.com/Questions/757149/status-error-in-calling-controller-action-method-w View Unanswered Questions View All Questions... Linux questions C# questions ASP.NET questions http://redhead-it.com/blog/2007/10/method_error_12030_when_using_cascadingdropdown/ 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# Free Tools Objective-C and Swift Database Hardware & method error 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 Who Most Valuable Professionals The Lounge The Insider News The Weird method error 12030 & 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 status 12030 error in calling controller action method with ajax. Rate this: Please Sign up or sign in to vote. See more: Ajax MVC Hi in the jquery-1.9.1.js file , there is a section of code // Listener callback = function( _, isAbort ) { var status, responseHeaders, statusText, responses; // Firefox throws exceptions when accessing properties // of an xhr when a network error occurred // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { // Was never called and is aborted or complete if ( callback && ( isAbort || xhr.readyState === 4 ) ) { // Only called once callback = undefined; // Do not keep as active anymore if ( handle ) { xhr.onreadystatechange = jQuery.noop; if ( xhrOnUnloadAbort ) { delete xhrCallbacks[ handle ];
using CascadingDropDowns linked to a databse as described on http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Walkthrough/CCDWithDB.aspx Unfortunatly, the code contains a little bug, resulting a Method error 12030 or Method error 12031 being displayed in the dropdownlist, instead of the expected data. Because the webservice is being called from (java)script, using ASP.NET AJAX, the enclosing class has to be decorated with the System.Web.Script.Services.ScriptService attibute to make it work. C#: [System.Web.Script.Services.ScriptService()] public class MyWebserviceClass : System.Web.Services.WebService { [WebMethod] public function MyWebServiceFunction() { // function body } } VB: Public Class MyWebserviceClass Inherits System.Web.Services.WebService Public Function MyWebServiceFunction() ' function body End Function End Class Too bad Microsoft forgot to mention this in the example! Method error 12002 And when we're at it: Method error 12002 indicates a timeout error, not uncommon when debugging. Method Error 500 This may also occur from time to time. It's the server telling you there's been an Internal Server Error with code 500. You may want to debug the web service you're using when you see this error. This entry was posted in C#, DotNET, Programming, VB and tagged ajax, error, webservice. Bookmark the permalink. ← Base64 encoder/decoder DotNET → Leave a Reply Cancel reply Your email address will not be published. Required fields are marked * Name * Email * Website Comment Search for: Recent Posts The cast to value type ‘Int32' failed because the materialized value is null. Either the result type's generic parameter or the query must use a nullable type (when databinding to a LINQ query) An unhandled exception of type ‘System.ArgumentException' occurred in UserControlTestContainer.exe Determine where a javascript alert is coming from Windows power configuration Disable weak SSL ciphers on IIS 6 and Windows Server 2003 Recent CommentsElmer on Extracting a substring from a TEXT field in MySQLSerge on Extracting a substring from a TEXT field in MySQLtomclock on HttpContext.Current.Request.UserHostAddress returns ::1Alex on Installing Windows Fundamentals (WinFLP) on Asus Eee PCElmer on Installing Windows Fundamentals (WinFLP) on Asus Eee PCArchives December 2013 November 2013 October 2013 July 2013 May 2013 April 2013 February 2013 January 2013 September 2012 June 2012 September 2011 August