If you do not specify any factory in the .svc file, all endpoints will be obtained from the web.config file - WCF will try to find the <system.serviceModel / service>
element, the name
attribute matches the value > fully qualified class of service. If he does not find it, he will add a default endpoint (using basicHttpBinding
if you have not changed the default mapping). This seems to be what you came across. Confirm that the "name" attribute of the <service>
element matches the value of the Service
attribute in the .svc file, and you must clearly define the two endpoints.
Another thing you can try to do is enable tracing in the service (level = Information) to see which endpoints were actually open in the service. Image below:

The server for this example has nothing to do:
namespace MyNamespace { [ServiceContract] public interface ITest { [OperationContract] string Echo(string text); } public class Service : ITest { public string Echo(string text) { return text; } } }
Service.svc does not specify factory:
<% @ServiceHost Service="MyNamespace.Service" Language="C#" debug="true" %>
And web.config defines two endpoints that are shown on the track:
<configuration> <system.diagnostics> <sources> <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true"> <listeners> <add type="System.Diagnostics.DefaultTraceListener" name="Default"> <filter type="" /> </add> <add name="ServiceModelTraceListener"> <filter type="" /> </add> </listeners> </source> </sources> <sharedListeners> <add initializeData="C:\temp\web_tracelog.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelTraceListener" traceOutputOptions="Timestamp"> <filter type="" /> </add> </sharedListeners> <trace autoflush="true"/> </system.diagnostics> <system.serviceModel> <behaviors> <endpointBehaviors> <behavior name="Web"> <webHttp /> </behavior> </endpointBehaviors> </behaviors> <services> <service name="MyNamespace.Service"> <endpoint address="basic" binding="basicHttpBinding" bindingConfiguration="" name="basic" contract="MyNamespace.ITest" /> <endpoint address="web" behaviorConfiguration="Web" binding="webHttpBinding" bindingConfiguration="" name="web" contract="MyNamespace.ITest" /> </service> </services> </system.serviceModel> </configuration>
Note that there is an additional listener in the listener, this is the "help page" from the WCF (the one that reports when viewing on it that the service does not have metadata).
You can either try to compare this setting with yours, or start with this simple one, and then start adding the component from yours until you encounter a problem. This will help isolate the problem.
Good luck
source share