3

I have an ajax call to http://mydomain.com/ClientServices/RewardsService.asmx/DisableDivAppsAreNotSupported

which throws the following error:

<span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

<h2> <i>Request format is unrecognized for URL unexpectedly ending in '/DisableDivAppsAreNotSupported'.</i> </h2></span>

<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

<b> Description: </b>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.

<br><br>

<b> Exception Details: </b>System.InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/DisableDivAppsAreNotSupported'.<br><br>

<b>Source Error:</b> <br><br>

<table width=100% bgcolor="#ffffcc">
   <tr>
      <td>
          <code>

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.</code>

      </td>
   </tr>
</table>

<br>

Why doesn't it recognize the op at the end of the url?

Chris Ledet
  • 11,458
  • 7
  • 39
  • 47
Elad Benda
  • 35,076
  • 87
  • 265
  • 471
  • 1
    See [this question](http://stackoverflow.com/questions/654099/how-do-i-fix-a-request-format-is-unrecognized-for-url-error-in-a-web-sevic) – GregL Oct 27 '11 at 16:23

1 Answers1

3

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 and post are enabled:

<configuration>
    <system.web>
    <webServices>
        <protocols>
            <add name="HttpGet"/>
            <add name="HttpPost"/>
        </protocols>
    </webServices>
    </system.web>
</configuration>
James Hill
  • 60,353
  • 20
  • 145
  • 161
  • My bad, the ajax calls "../DisableDivAppsAreNotSupported" and get this error. script services is enabled. I want to return void, not Json. Any other idea? – Elad Benda Oct 28 '11 at 14:52
  • Post your JS/jQuery and your service definition (at least the signature of the method). Also, see edit - have you checked your get and post protocols? – James Hill Oct 28 '11 at 15:13