Ajax call to webservice fails-Collection of common programming errors
I have an ajax call to http://mydomain.com/ClientServices/RewardsService.asmx/DisableDivAppsAreNotSupported
which throws the following error:
Server Error in '/' Application.
Request format is unrecognized for URL unexpectedly ending in '/DisableDivAppsAreNotSupported'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/DisableDivAppsAreNotSupported'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Why doesn’t it recognize the op at the end of the url?
-
Your URL is incorrect. Try:
http://mydomain.com/ClientServices/RewardsService.asmx/DisableDivAppsAreNotSupported
A couple additional things to check:
-
Ensure that script services is enabled
[System.Web.Script.Services.ScriptService]
-
Ensure net’s expecting JSON
[ScriptMethod(ResponseFormat=ResponseFormat.Json)]
-
Ensure
get
andpost
are enabled:
-
Originally posted 2013-11-29 06:06:35.