Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default wcf service application has no endpoint defined

Tags:

c#

wcf

I just created a new WCF Service Application project in VS2010 (Premium), and it works out-of-the-box, but when I opened up the web.config file there are no endpoints present. The application works fine and I can open the address (http://localhost:50639/Service1.svc?wsdl) in a browser and I can see the contract and it all looks fine.

So my question is if the default project has uses a different approach rather then placing the information in the web.config? I can't see anything in the code either.

To show my point this is all that the web.config contains:

<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false     and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the     value below to true.  Set to false before deployment to avoid disclosing exception     information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>

And still this service works and I can both connect and call the default methods (e.g. GetData())

like image 424
Thomas Avatar asked Nov 19 '10 10:11

Thomas


1 Answers

That is not a "different" approach. It is a new approach in WCF 4.0 called simplified configuration. If you create project in .NET 4.0 you will get this simplified mode. If you create project in .NET 3.5 you will get old chatty configuration.

like image 55
Ladislav Mrnka Avatar answered Oct 14 '22 08:10

Ladislav Mrnka