asp.net - JQuery AJAX POST Not Working on IIS -
thanks in advance help..
i have web service in visual studio project looks this:
[operationcontract] [webinvoke(method = "post", responseformat = webmessageformat.json, bodystyle = webmessagebodystyle.wrapped, requestformat = webmessageformat.json, uritemplate = "/grade")] string gradeprocess(string s0, string s1, string s2, string s3);
i have simple vs project simple html page calls web service this:
$.ajax({ url: 'http://myremotewebserver/gradeprocess.svc/grade', contenttype: 'application/json; charset=utf-8', data: json.stringify(postdata), datatype: "json", type: 'post', cache: false, async: false, success: function (data) { onsuccess(data, response); }, error: function (data) { onerror(data, response); } });
locally, can run web service first (f5), , change url of post in html page vs project use local web service, run well, , works fine (i.e. url: 'http://localhost/gradeprocess.svc/grade').
thinking i'm done, created 2 websites on windows 2012 machine , published both sites iis 8 (changing url of ajax post reference remote server). can browse both , can see standard asp web service base page, html page. both seem hosted properly.
but post no longer functions on iis server. have tried modifying web.config countless ways remove webdavmodule, settings enable cors, , tons of others. tinkered things like
<add name="extensionlessurlhandler-isapi-4.0_32bit" path="*." verb="get,head,post,debug,put,delete,patch,options" modules="isapimodule" scriptprocessor="%windir%\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll" precondition="classicmode,runtimeversionv4.0,bitness32" responsebufferlimit="0" />
i have modified iis server make sure svc handlers in place, reordered them, , again, lot of other settings.
in fiddler, keep getting "method not allowed" response. if try navigate 'http://myremotewebserver/gradeprocess.svc/grade' browser, see "method not allowed" warning. guess biggest challenge understanding need debug this. part of me thinks application/json setting problem, , thinks may path issue (i.e. url path , route definition).
any insight how debug appreciated.
Comments
Post a Comment