WCF和IIS 6-未公开WSDL

WCF和IIS 6-未公开WSDL,wcf,iis,iis-6,wsdl,Wcf,Iis,Iis 6,Wsdl,我开发了一个包含WCF服务的ASP.NET应用程序。此服务需要由第三方应用程序使用。在我的开发环境中进行测试时,该服务运行良好。我的开发环境在Windows7RC1上使用IIS 7.0。但是,一旦该服务位于暂存/生产环境中,我就无法使用它。我的暂存/生产环境是Windows Server 2003 IIS 6环境 <system.serviceModel> <behaviors> <serviceBehaviors> <behav

我开发了一个包含WCF服务的ASP.NET应用程序。此服务需要由第三方应用程序使用。在我的开发环境中进行测试时,该服务运行良好。我的开发环境在Windows7RC1上使用IIS 7.0。但是,一旦该服务位于暂存/生产环境中,我就无法使用它。我的暂存/生产环境是Windows Server 2003 IIS 6环境

<system.serviceModel>
  <behaviors>
    <serviceBehaviors>
      <behavior name="myServiceBehavior">
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="false" />
      </behavior>
    </serviceBehaviors>
  </behaviors>

  <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
  <services>
    <service behaviorConfiguration="myServiceBehavior" name="myService">
      <endpoint address="" binding="basicHttpBinding" contract="myService" />
      <endpoint address="mex" binding="mexHttpBinding" 
        contract="IMetadataExchange" />
    </service>
  </services>
</system.serviceModel>
当我尝试在IIS 6环境中引用该服务时,我收到一个错误,显示:

错误:无法获取元数据

有趣的是,我注意到在测试阶段/生产环境时有一个微妙但我相信很重要的区别

在我的测试环境中,我注意到我可以通过带有以下模板的url访问服务页面:

我还注意到,在我的测试环境中,如果使用以下模板访问url,我可以看到WSDL信息:

但是,在我的登台/生产环境中,我看不到WSDL信息。奇怪的是,我能看到服务页面

以下是与我的生产环境中的服务相关的配置设置

<system.serviceModel>
  <behaviors>
    <serviceBehaviors>
      <behavior name="myServiceBehavior">
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="false" />
      </behavior>
    </serviceBehaviors>
  </behaviors>

  <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
  <services>
    <service behaviorConfiguration="myServiceBehavior" name="myService">
      <endpoint address="" binding="basicHttpBinding" contract="myService" />
      <endpoint address="mex" binding="mexHttpBinding" 
        contract="IMetadataExchange" />
    </service>
  </services>
</system.serviceModel>

为什么在WindowsServer2003IIS6.0环境中我可以看到服务页面而不能看到WSDL页面


谢谢大家!

您启用了元数据交换吗

    <serviceMetadata httpGetEnabled = "true"/>

您是否定义了元数据交换端点

    <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
      name="mexendpoint" contract="IMetadataExchange" />

要添加到答案中,以下MSDN文章将合理详细地介绍发布服务元数据:


和Chad离线交谈,他向我保证没有花栗鼠。我在等待配置详细信息的到来之前拒绝做出判断。顺便说一句,我认为我是原创的,但我想不是:。配置详细信息现在在问题正文中提供。谢谢你来参加高峰会。