A wcf service application has no endpoint by default

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

So my question is, does the project use a different approach by default rather than posting information in web.config? I also do not see anything in the code.

To show your point, this is all that the web.config file 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 yet this service works, and I can connect and call the default methods (e.g. GetData ())

+6
c # wcf
source share
1 answer

This is not a β€œdifferent” approach. This is a new approach in WCF 4.0 called simplified configuration . If you create a project in .NET 4.0, you will get this simplified mode. If you create a project in .NET 3.5, you will get the old chat configuration.

+8
source share

All Articles