C# 默认wcf服务应用程序未定义终结点
我刚刚在VS2010(Premium)中创建了一个新的WCF服务应用程序项目,它是开箱即用的,但是当我打开web.config文件时,没有端点。应用程序运行良好,我可以打开地址(http://localhost:50639/Service1.svc?wsdl)在浏览器中,我可以看到合同,一切看起来都很好 所以我的问题是,默认项目是否使用了不同的方法,而不是将信息放在web.config中?我也看不到代码中的任何内容 为了说明我的观点,web.config包含以下内容:C# 默认wcf服务应用程序未定义终结点,c#,wcf,C#,Wcf,我刚刚在VS2010(Premium)中创建了一个新的WCF服务应用程序项目,它是开箱即用的,但是当我打开web.config文件时,没有端点。应用程序运行良好,我可以打开地址(http://localhost:50639/Service1.svc?wsdl)在浏览器中,我可以看到合同,一切看起来都很好 所以我的问题是,默认项目是否使用了不同的方法,而不是将信息放在web.config中?我也看不到代码中的任何内容 为了说明我的观点,web.config包含以下内容: <?xml vers
<?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>
这项服务仍然有效,我可以连接并调用默认方法(例如GetData()),这不是一种“不同”的方法。这是WCF 4.0中的一种新方法,称为。如果您在.NET4.0中创建项目,您将获得此简化模式。如果您在.NET 3.5中创建项目,您将获得旧的聊天配置。HTTPS是否如此?我找不到任何推荐人。对不起,我自己也试过了。是的,它也适用于HTTPs:)非常简单,您只需要设置正确的绑定“TransportSecurity”、证书和正确的绑定。简化的配置可以在HTTPs和非HTTPs中工作。有人知道在创建WCF服务项目时如何打开“聊天”版本吗?微软并没有通过混淆设置来帮任何人的忙,特别是对于我们这些试图学习WCF的人来说。