Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>I see that the biggest difference between the WCF test client request and my ajax request is that I make a GET request and pass in the name of the web service method in the url while the WCF test client makes a post request and sends in the web service method name in a SOAP envelope.</p> </blockquote> <p>Seems that your service is configured with SOAP binding and cannot work with AJAX Get requests.</p> <p>You need to use <code>WebHttpBinding</code> if you want to consume your service from JS.</p> <ol> <li>Add <code>[WebGet]</code> attribute got your operation </li> <li>Change binding in your endpoint - <code>binding="webHttpBinding"</code> </li> <li>Configure behavior for endpoint</li> </ol> <p>There are many samples in internet. For example this one <a href="http://bendewey.wordpress.com/2009/11/24/using-jsonp-with-wcf-and-jquery/" rel="nofollow">http://bendewey.wordpress.com/2009/11/24/using-jsonp-with-wcf-and-jquery/</a> </p> <pre><code>&lt;endpointBehaviors&gt; &lt;behavior name="webBehavior"&gt; &lt;webHttp /&gt; &lt;/behavior&gt; &lt;/endpointBehaviors&gt; </code></pre> <p>You need to add service section to your web.config file. Host does not know that you want to use <code>webHttpBinding</code> unless you tell him.</p> <pre><code>&lt;services&gt; &lt;service name="Service1"&gt; &lt;endpoint address="" binding="webHttpBinding" contract="IService1" /&gt; &lt;/service&gt; &lt;/services&gt; </code></pre> <p>Link below provides detailed instructions for hosting service in IIS (with <code>wsHttpBinding</code>). You just need to use <code>webHttpBinding</code> instead of <code>wsHttpBinding</code> - <a href="http://msdn.microsoft.com/en-us/library/ms733766.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms733766.aspx</a></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.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      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