Click here to Skip to main content
15,887,477 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

I would like to host my 'WCF REST' service without IIS. I have used the following url (http://msdn.microsoft.com/en-us/library/community/add/ms733069(v=vs.90).aspx[^]) and successfully implemented the sample given.

But when I tried to implement my WCF Rest service, I got the following exception....

XML
Service 'xxx' 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.


Contents of my app.config is given below....

XML
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <services>
      <service name="Microsoft.ServiceModel.Samples.RestService"
               behaviorConfiguration="RestServiceBehavior">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8000/ServiceModelSamples/service"/>
          </baseAddresses>
        </host>
        <endpoint address=""
                  binding="wsHttpBinding"
                  contract="Microsoft.ServiceModel.Samples.IRestService" />
        <endpoint address="mex"
                  binding="mexHttpBinding"
                  contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="RestServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="False"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>


Can someone help me to solve this?

Thanks & regards
Sebastian
Posted
Updated 23-Jul-13 2:53am
v2

1 solution

Hi sebastin,
Your service name
<service>name="Microsoft.ServiceModel.Samples.RestService" />
should be same as Service namespace. this work for me.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900