c# - 如何使用 basicHttpBinding(SOAP,而非 REST)启用 Wcf 帮助页面

标签 c# wcf soap

我正在尝试在我的 Wcf 服务中启用 Wcf 服务 帮助页面,但没有尝试成功,在链接 <.....{servicename}.svc/help> 下没有带有服务方法描述的可用帮助页面

我尝试了我设法找到的任何提示,但没有结果。

是否可以使用 basicHttpBinding 为 wcf 服务启用自动帮助页面?

我的 Wcf 服务托管在 Asp.net 应用程序中

这是来自 we.config 的我的 wcf 配置部分:

<serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
        <behavior name="EcoscadaApi">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" httpGetUrl="" />
          <serviceDebug includeExceptionDetailInFaults="true" httpHelpPageEnabled="true"   httpsHelpPageEnabled="true" />
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="EndpointBehavior">
          <webHttp helpEnabled="true"/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_HvacControlService" sendTimeout="00:05:00" />
        <binding name="ecoWcfBinding" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647"  >
          <readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647" />
        </binding>
      </basicHttpBinding>
    </bindings>
    <services>
      <service name="EcoSCADA.Web.Services.Wcf.BuildingComponentService" behaviorConfiguration="EcoscadaApi">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost/Services/wcf/BuildingComponentService" />
          </baseAddresses>
        </host>
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="ecoWcfBinding" contract="EcoSCADA.Web.Services.Wcf.IBuildingComponentService" />
        <endpoint address="mex" binding="mexHttpBinding" name="Metadata"  contract="IMetadataExchange" />
      </service>

任何评论/提示将不胜感激。

最佳答案

你试过了吗this :

<endpointBehaviors>
    <behavior name="DefaultEndPointBehavior">
        <webHttp helpEnabled="true" />
    </behavior>
</endpointBehaviors>

更新:查看this我注意到它们包含帮助页面的特定端点:

<services>
  <service behaviorConfiguration="RESTWebServiceBehavior" name="RESTWebService">
    <endpoint address="" kind="webHttpEndpoint" behaviorConfiguration="RESTEndpointBehavior" contract="IHello" />
  </service>
</services>

关于c# - 如何使用 basicHttpBinding(SOAP,而非 REST)启用 Wcf 帮助页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26295196/

相关文章:

c# - foreach 未初始化循环变量

c# - 如何使用 json 通过 SSL 在 IIS 中托管的 WCF 端点上使用基本身份验证?

php - 消息 '' 上指定的 SOAP 操作与 HTTP SOAP 操作不匹配,

Spring WS : Why is Spring WS returning WebServiceTransportException instead of a SoapFaultException

python - 使用 Python 访问 Outlook API

c# - 如何拆分具有多个分隔符的行?

c# - 运行测试时特定机器上出现 OutOfMemoryException

c# - 条件表达式中的数据类型与 REPLACE 不匹配,没有要替换的内容

c# - 如何在 WCF 中使用 SSL 加密

c# - 使用Entity Framework 为什么要重新启动DbContext?