Note that there are some explanatory texts on larger screens.

plurals
  1. POWCF json endpoint not found
    primarykey
    data
    text
    <p>I am new to WCF and was testing a simple example, with which I got stuck for too long. The error or things I missed might be stupid, but please help me with it. Thanks a lot in advance.</p> <p>Here comes my description of the problem:</p> <p>I was testing a WCF service with json enabled, which is implemented in my <code>CalService.svc.cs</code> file by the following code:</p> <pre><code>namespace SharePoint.WebServices { [ServiceContract] public interface ICalculators { [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json )] float Weight(float width, float diameter, float size, float factor); } public class Calculators : ICalculators { public float Weight(float width, float diameter, float size, float factor) { return 10f; } } } </code></pre> <p>and my <code>CalService.svc</code> file is like this: </p> <pre><code>&lt;%@ ServiceHost Language="C#" Debug="true" Service="SharePoint.WebServices.Calculators" Factory="System.ServiceModel.Activation.WebServiceHostFactory" CodeBehind="CalService.svc.cs" %&gt; </code></pre> <p>I test it my sample service with IE. I was notified of the <code>no endpoint found</code> message. Thus, I think the problem comes from my web.config file. Here it is:</p> <pre><code>&lt;system.serviceModel&gt; &lt;services&gt; &lt;service name="SharePoint.WebServices.Calculators"&gt; &lt;endpoint address="" behaviorConfiguration="JsonBehavior" binding="webHttpBinding" contract="SharePoint.WebServices.ICalculators" /&gt; &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt; &lt;/service&gt; &lt;/services&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior&gt; &lt;serviceMetadata httpGetEnabled="true"/&gt; &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;endpointBehaviors&gt; &lt;behavior name="JsonBehavior"&gt; &lt;webHttp /&gt; &lt;/behavior&gt; &lt;/endpointBehaviors&gt; &lt;/behaviors&gt; &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt; &lt;/system.serviceModel&gt; </code></pre> <p>I've checked all the points that are made by folks who replied similar threads regarding json-enabled wcf, but still had the endpoint issue. Please help!</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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