默认的wcf服务应用程序没有定义端点

我刚刚在VS2010(Premium)中创建了一个新的WCF服务应用程序项目,并且它可以直接使用,但是当我打开web.config文件时,没有端点存在。 该应用程序工作正常,我可以在浏览器中打开地址(http:// localhost:50639 / Service1.svc?wsdl),我可以看到合同,它看起来都很好。

所以我的问题是,如果默认项目使用不同的方法,而不是将信息放在web.config中? 我在代码中也看不到任何东西。

为了显示我的观点,这是web.config包含的全部内容:

<?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中一种称为简化配置的新方法。 如果你在.NET 4.0中创建项目,你会得到这个简化模式。 如果你在.NET 3.5中创建项目,你会得到旧的健谈配置。

链接地址: http://www.djcxy.com/p/95895.html

上一篇: Default wcf service application has no endpoint defined

下一篇: "type not defined" exception with WF4 RC