eran otzap
eran otzap

Reputation: 12533

Service '' has zero application (non-infrastructure) endpoints

i keep getting an unexplained exception

 Service 'EmployeeManagerImplementation.EmployeeManagerService' has zero application (non-infrastructure) 
 endpoints. This might be because no configuration file was found for your application, 
 or because no service element matching the service name could be found in the configuration file,   or because no endpoints were defined in the service element.

iv'e come across other posts which have solved this problem , but no one seems to have a precise answer , and non of their solutions worked for me .

Service has zero application (non-infrastructure) endpoints

any ways here's my app.config

 <system.serviceModel>
    <services>
        <service name="Some.Test.EmployeeManagerService">
            <endpoint address="net.tcp://localhost:8080/Service" binding="netTcpBinding"
                bindingConfiguration="" contract="Contracts.IEmployeeManagerService" />
            <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
        </service>
    </services>
</system.serviceModel>

my Contract:

[ServiceContract(Namespace="Some.Test")]
public interface IEmployeeManagerService
{
    [OperationContract]
    string Test();    
}

My Service :

public class EmployeeManagerService : IEmployeeManagerService
{
    public string Test()
    {
        return "test";
    }
}

in the related post people advised to give the Contract a namespace , and to use that as a prefix in my app.config for the name in the service tab .

also there was a suggestion to expose the mex end point ... i don't really see what this as to do with it but i did it any ways .

so any ideas of why this happens ? and how to really resolve this issue ?

Upvotes: 15

Views: 28935

Answers (5)

Kemal AL GAZZAH
Kemal AL GAZZAH

Reputation: 1037

I faced the same problem with my wcf soap application when deploying in https.

I fixed it by using this config in web.config: This link helped me to find the solution

<system.serviceModel>
 <services>  
      <service name="MyWebService.Service1">  
        <endpoint address=""  
                  binding="basicHttpBinding"  
                  bindingConfiguration="secureHttpBinding"  
                  contract="MyWebService.IService1"/>  

        <endpoint address="mex"  
                  binding="mexHttpsBinding"  
                  contract="IMetadataExchange" />  
      </service>  
</services>  
    <bindings>
      <basicHttpBinding>        
        <binding name="secureHttpBinding">  
          <security mode="Transport">  
            <transport clientCredentialType="None"/>  
          </security>  
        </binding>  
      </basicHttpBinding>
    </bindings>
   
    <behaviors>
      <serviceBehaviors>
        <behavior>
          
          <serviceMetadata httpGetEnabled="false"/>             
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
     
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>        
  </system.webServer>

Upvotes: 0

Pflugs
Pflugs

Reputation: 824

For my issue, I had all the namespaces set correctly as well. But what I failed to do was add a basicHttpBinding endpoint for the service itself. See this MSDN article, the first XML config section for an example.

Upvotes: 1

ziaprog
ziaprog

Reputation: 1557

Copy app.config from service to console app which is hosting the service

If you have created the service as a class library project and you are using console application to host it then just copy the app.config file from the service into the console application

Upvotes: 2

nbi
nbi

Reputation: 1386

The name of the service should be same as the class file that implement the interface i.e Interface.

    namespace WCFDemo
{
    public interface IWorker
    {
    }
}

and suppose you implemented it as

namespace WCFDemo
{
   public class WorkHere:Iworker
  {
  }
}

Then service name would be <service name="WCFDemo.WorkHere">

Upvotes: 1

Phil Patterson
Phil Patterson

Reputation: 1262

From your own comment:

Set the name attribute of the service to the exact same name as the implementation including the namespace

<service name="EmployeeManagerImplementation.EmployeeManagerService">

Upvotes: 11

Related Questions