title: Request format is unrecognized for URL unexpectedly ending
body: <p><img src="https://i.stack.imgur.com/rMD7K.png" alt="enter image description here">
  hi experts i am having a problem</p>
  
  <p>when i try my web service on a local machine it works fine</p>
  
  <p>but after i uploaded it and run on a hosted server windows server 2008 r2 asp.net 4.0</p>
  
  <p>i get an error like this Request format is unrecognized for URL unexpectedly ending in /setmylocation</p>
  
  <p>i tried these solutions</p>
  
  <pre><code>    &lt;system.webServer&gt;
              &lt;handlers&gt;
                  &lt;add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/&gt;
                  &lt;add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
              &lt;/handlers&gt;
          &lt;/system.webServer&gt;
  
  
      &lt;configuration&gt;  
          &lt;system.web&gt;  
          &lt;webservices&gt;  
              &lt;protocols&gt;  
                  &lt;add name="HttpGet"&gt;&lt;/add&gt;  
                  &lt;add name="HttpPost"&gt;&lt;/add&gt;  
              &lt;/protocols&gt;  
          &lt;/webservices&gt;  
          &lt;/system.web&gt;  
      &lt;/configuration&gt;
  
  and here is my client side code
  
      $.ajax({
                          type: "POST",
                          url: "locations.asmx/setmylocation",
                          data: "{proid: '" + proid + "'}",
                          contentType: "application/json; charset=utf-8",
                          dataType: "json",
                          success: function (response) {
                              var urloc = response.d;
  
                              if (urloc[0].LATITUDE == '') {
  
                                  initializemap(14.001424154457723, 121.1032415625, 7);
  
                              } else {
                                  initializemap(urloc[0].LATITUDE, urloc[0].LONGITUDE, 10);
  
  
                              }
  
                          },
                          failure: function (response) {
                              alert(response.d);
                          }
                      }); 
  </code></pre>
  
  <p>i tried everything but the problem persist hoping to get an answer to the problem</p>
  
  <p>thank you</p>
  
  <p>the picture above shows that other web service calls are just fine</p>
  
  <p>and the error from elmah.axd</p>
  
  <pre><code>System.InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/setmylocation'.
     at System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)
     at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath)
     at System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
     at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
     at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously)
  </code></pre>