我正在尝试在我的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>
任何评论/提示都将不胜感激。
答案 0 :(得分:4)
您是否尝试过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>
答案 1 :(得分:2)
Help page仅适用于 webHttpBinding