Note that there are some explanatory texts on larger screens.

plurals
  1. PORequesting WCF Rest Service into JQGrid works with IE and not working with Chrome or Mozilla
    primarykey
    data
    text
    <p>i used WCF Restful Services as my business layer, when i try to 'GET' data from the service in IE 9 it just works fine and fill the JQgrid, but when i was trying to open the same page with Chrome or Firefox i got this error message.</p> <pre><code>{ "statusText": "", "responseText": "", "response": "", "onabort": null, "readyState": 4, "upload": { "onloadstart": null, "onabort": null, "onerror": null, "onload": null, "onprogress": null }, "onerror": null, "onreadystatechange": null, "status": 0, "responseXML": null, "onprogress": null, "onload": null, "withCredentials": false, "onloadstart": null, "responseType": "" } </code></pre> <p>Service.svc</p> <pre><code> [WebGet(UriTemplate = "LT_SectionListPage/?pageIndex={pageIndex}&amp;pageSize={pageSize}&amp;sortOrder={sortOrder}&amp;sortColumn={sortColumn}", ResponseFormat = WebMessageFormat.Json)] [OperationContract] </code></pre> <p><strong>I used Fiddler2 to trace things out and here is the out put with IE9</strong></p> <pre><code>HTTP/1.1 200 OK Server: ASP.NET Development Server/10.0.0.0 Date: Thu, 12 May 2011 11:53:40 GMT X-AspNet-Version: 2.0.50727 Cache-Control: private Content-Type: application/json; charset=utf-8 Content-Length: 847 Connection: Close </code></pre> <p><strong>and the output with Chrome</strong></p> <pre><code>HTTP/1.1 405 Method Not Allowed Server: ASP.NET Development Server/10.0.0.0 Date: Thu, 12 May 2011 11:54:07 GMT X-AspNet-Version: 2.0.50727 Cache-Control: private Content-Type: text/html Content-Length: 1137 Connection: Close &lt;html version="-//W3C//DTD XHTML 2.0//EN" xml:lang="en" xsi:schemaLocation="http://www.w3.org/1999/xhtml http:// www.w3.org/MarkUp/SCHEMA/xhtml2.xsd" xmlns="http:// www.w3.org/1999/xhtml" xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance"&gt;&lt;HEAD&gt;&lt;TITLE&gt;Request Error&lt;/TITLE&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV id="content"&gt;&lt;P class="heading1"&gt;&lt;B&gt;Error Description:&lt;/B&gt; 'HTTP Method not allowed'&lt;/P&gt;&lt;P&gt;&lt;B&gt;This may be because an invalid URI or HTTP method was specified. Please see the &lt;A HREF="http:// localhost:1111/Rest.svc/help"&gt;service help page&lt;/A&gt; for constructing valid requests to the service.&lt;/B&gt;&lt;/P&gt;&lt;!-- Padding xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx--&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/html&gt; </code></pre> <p>Request in Chrome <code></p> <pre><code>OPTIONS http:// localhost:1111/Rest.svc/LT_SectorListPage/json/?pageIndex=1&amp;pageSize=100&amp;sortOrder=asc&amp;sortColumn=ID&amp;_=1305207336766 HTTP/1.1 Host: localhost:1111 Connection: keep-alive Referer: http:// localhost:1407/Default.aspx Access-Control-Request-Method: GET Origin: http:// localhost:1407 User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.24 Access-Control-Request-Headers: X-Requested-With, Accept Accept: */* Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 </code></pre> <p></code></p> <p>Request In IE9</p> <p><code></p> <pre><code>GET http:// localhost:1111/Rest.svc/LT_SectorListPage/json/?pageIndex=1&amp;pageSize=100&amp;sortOrder=asc&amp;sortColumn=ID&amp;_=1305207423633 HTTP/1.1 x-requested-with: XMLHttpRequest Accept-Language: ar-JO,en-US;q=0.5 Referer: http:// localhost:1407/Default.aspx Accept: text/plain, */* Accept-Encoding: gzip, deflate User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) Host: localhost:1111 Connection: Keep-Alive Cookie: ASP.NET_SessionId=d212qpnffmvrzit1sx4z1mzb </code></pre> <p></code></p> <p>Chrome does not accepts the method and IE9, any help would be appreciated.</p> <p>Thanks</p> <p>[Updated Fiddler Status]</p> <p>after adding the following code into Global.asax to handle the CORS issue</p> <p><code></p> <pre><code>protected void Application_BeginRequest(object sender, EventArgs e) { HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache); HttpContext.Current.Response.Cache.SetNoStore(); HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin","*"); if (HttpContext.Current.Request.HttpMethod == "OPTIONS") { HttpContext.Current.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST"); HttpContext.Current.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept"); HttpContext.Current.Response.End(); } } </code></pre> <p></code></p> <p><strong>Request</strong></p> <pre><code>OPTIONS http:// localhost:1111/Rest.svc/LT_SectorListPage/json/?pageIndex=1&amp;pageSize=100&amp;sortOrder=asc&amp;sortColumn=ID&amp;_=1305213078870 HTTP/1.1 Host: localhost:1111 Connection: keep-alive Referer: http:// localhost:1212/Default.aspx Access-Control-Request-Method: GET Origin: http:// localhost:1212 User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.24 Access-Control-Request-Headers: X-Requested-With, Accept Accept: */* Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 </code></pre> <p><strong>Response</strong></p> <p><code></p> <pre><code>HTTP/1.1 200 OK Server: ASP.NET Development Server/10.0.0.0 Date: Thu, 12 May 2011 15:11:18 GMT X-AspNet-Version: 2.0.50727 Access-Control-Allow-Origin: * Access-Control-Allow-Methods: GET, POST Access-Control-Allow-Headers: Content-Type, Accept Cache-Control: no-cache, no-store Pragma: no-cache Expires: -1 Content-Length: 0 Connection: Close </code></pre> <p></code></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload