Note that there are some explanatory texts on larger screens.

plurals
  1. POCall JSON wcf service via jQuery
    primarykey
    data
    text
    <p>I have question according calling json wcf methods from aspx page with jQuery.</p> <p>This is my test method:</p> <pre><code> [ServiceContract] public interface IEParcelService { [OperationContract] [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "Test")] Response&lt;string&gt; Test(); } [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class EParcelServiceImpl : IEParcelService { public Response&lt;string&gt; Test() { return WebServiceHelper.Execute(() =&gt; "Test Message"); } } </code></pre> <p>This service deployed to IIS. When I call this method from Chrome: <a href="http://localhost/TestService/ServiceImpl.svc/Test" rel="nofollow">http://localhost/TestService/ServiceImpl.svc/Test</a> Everything is ok and I can see the result. But when I call it from jQuery I have error: NETWORK_ERR: XMLHttpRequest Exception 101. I try to find solution in Google. But the result was not successful. How I can solve it?</p> <p>jQuery call:</p> <pre><code>&lt;script language="javascript"&gt; $().ready(function () { $("#myButt").click(function () { $.ajax({ cache: false, async: false, type: "GET", url: "http://localhost/EParselService/EParcelServiceImpl.svc/Test", contentType: "application/json", dataType: "json", success: function (data, textStatus){ alert('successCallBack called'); alert(data); alert(textStatus); }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert('errorCallBack called'); alert('textStatus = ' + textStatus + '/nerrorThrown = ' + errorThrown); } }); alert('Done!'); }); }); &lt;/script&gt; &lt;input type="button" value="Get values from server" id="myButt" /&gt; </code></pre>
    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.
    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