【问题标题】:How to enable Wcf help page with basicHttpBinding (SOAP, not REST)如何使用 basicHttpBinding(SOAP,而不是 REST)启用 Wcf 帮助页面
【发布时间】:2014-10-10 08:37:43
【问题描述】:

我正在尝试在我的 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>

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

【问题讨论】:

    标签: c# wcf soap


    【解决方案1】:

    你试过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>
    

    【讨论】:

    • 是的,我试过这个,但是我仍然在链接下得到空白页.....{servicename}.svc/help
    • 在第二篇文章中挣扎了一下,终于成功了!非常感谢 BCdotNET!
    • @robsonwk 你能告诉我你做了什么来让它工作吗?
    【解决方案2】:

    Help page 仅适用于 webHttpBinding

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-07-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-07
      • 2014-01-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多