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())
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With