title: Not hitting success event on AJAX call In asp.net
body: <p>I am trying to bind Drop down from services. But success event is not hitting.</p>
  <p>Science I have total 5000 records so in</p>
  <p><strong>web.config</strong> file I have added Binding May be due to this region I am getting &quot;Internal server Error&quot; ? I am not sure about this Please guide me where I am doing wrong</p>
  <p><strong>AJAX</strong></p>
  <pre><code>var AllProduct = [];
          function GetAllProduct() {
              var params = { DivisionCode: $('#ddlDivision').val() };
              $.ajax({
                  type: 'GET',
                  contentType: &quot;application/json; charset=utf-8&quot;,
                  data: JSON.stringify(params),
                  url: 'Header.aspx/GetProduct',
                  dataType: 'json',
                  async: false,
                  success: function (res) {
                      Product(res.d)
                      OnSuccessProductCall();
  
                  }
              });
              function Product(pdata) {
                  AllProduct = pdata;
              }
          }
          function OnSuccessProductCall(data, status) {
              result = AllProduct;
              $(&quot;[id$='ddlProduct']&quot;).append($(&quot;&lt;option&gt;&quot;).val(&quot;0&quot;).text(&quot;Select&quot;));
              if (result != undefined &amp;&amp; result.length &gt; 0) {
                  for (i = 0; i &lt; result.length; i++) {
                      $(&quot;[id$='ddlProduct']&quot;).append($(&quot;&lt;option&gt;&quot;).val($.trim(result[i].BU_CAT_CODE)).text($.trim(result[i].BU_CAT_DESC)));
                  }
              }
          }
  </code></pre>
  <p><strong>Services</strong></p>
  <p>While debugging I can see my services returning Collection of data But not able to hit Success Event</p>
  <pre><code> [WebMethod]
          public static ServiceReference1.PRODUCT[] GetProduct(string DivisionCode)
          {
              ServiceReference1.MasterDataServiceClient oClient = new ServiceReference1.MasterDataServiceClient();
              ServiceReference1.PRODUCT[] prod = oClient.GetProducts(DivisionCode, null, null, null, null, null, null, null);
              return prod;
          }
  </code></pre>
  <p><strong>Web.Cofig</strong></p>
  <pre><code>&lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;wsHttpBinding&gt;
          &lt;binding name=&quot;basicHttp&quot; allowCookies=&quot;true&quot;
               maxReceivedMessageSize=&quot;20000000&quot;
               maxBufferPoolSize=&quot;20000000&quot;&gt;
            &lt;readerQuotas maxDepth=&quot;32&quot;
                 maxArrayLength=&quot;200000000&quot;
                 maxStringContentLength=&quot;200000000&quot;/&gt;
          &lt;/binding&gt;
          &lt;binding name=&quot;WSHttpBinding_IMasterDataService&quot; /&gt;
        &lt;/wsHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;client&gt;
        &lt;endpoint address=&quot;http://almhosrwfebpm01.almaraigroup.local:8524/AlmaraiDataService.svc&quot; binding=&quot;wsHttpBinding&quot; bindingConfiguration=&quot;basicHttp&quot; contract=&quot;ServiceReference1.IMasterDataService&quot; name=&quot;WSHttpBinding_IMasterDataService&quot;&gt;
          &lt;identity&gt;
            &lt;dns value=&quot;localhost&quot; /&gt;
          &lt;/identity&gt;
        &lt;/endpoint&gt;
      &lt;/client&gt;
    &lt;/system.serviceModel&gt;
  </code></pre>
  <p>My data type is <code>JSON</code></p>
  <p>Sample data Coming from Web Services.</p>
  <p><a href="https://i.stack.imgur.com/wkziw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wkziw.png" alt="enter image description here" /></a>
  Where I am doing wrong.</p>
  <p><strong>Error Message</strong></p>
  <pre><code> {&quot;Message&quot;:&quot;An attempt was made to call the method \u0027GetProduct\u0027 using a POST request, which is not allowed.&quot;,&quot;StackTrace&quot;:&quot;   at System.Web.Script.Services.RestHandler.GetRawParams(WebServiceMethodData methodData, HttpContext context)\r\n   at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)&quot;,&quot;ExceptionType&quot;:&quot;System.InvalidOperationException&quot;}
  </code></pre>
  <p><a href="https://i.stack.imgur.com/zzlv4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zzlv4.png" alt="enter image description here" /></a></p>