Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/314.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何使用basicHttp绑定启用帮助页?_C#_Wcf_Binding_Web Config_Wcf Binding - Fatal编程技术网

C# 如何使用basicHttp绑定启用帮助页?

C# 如何使用basicHttp绑定启用帮助页?,c#,wcf,binding,web-config,wcf-binding,C#,Wcf,Binding,Web Config,Wcf Binding,我试图为basicHttpBinding启用帮助页面,但出现以下错误 The endpoint at 'http://localhost:52568/address.svc/ws' does not have a Binding with the None MessageVersion. 'System.ServiceModel.Description.WebHttpBehavior' is only intended for use with WebHttpBinding or simila

我试图为basicHttpBinding启用帮助页面,但出现以下错误

The endpoint at 'http://localhost:52568/address.svc/ws' does not have a Binding with the None MessageVersion.  'System.ServiceModel.Description.WebHttpBehavior' is only intended for use with WebHttpBinding or similar bindings.
  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.Store">  
    <endpoint address="ms" binding="basicHttpBinding"   contract="MCDThirdPartyService.IStore" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>    

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.address">
    <endpoint address="ws" binding="basicHttpBinding" contract="MCDThirdPartyService.Iaddress" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.Configuration">
    <endpoint address="ws" binding="basicHttpBinding" contract="MCDThirdPartyService.IConfiguration" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.Order">
    <endpoint address="ws" binding="basicHttpBinding" contract="MCDThirdPartyService.IOrder" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="0" aspNetCompatibilityEnabled="true"/>


 <behaviors>
  <endpointBehaviors>        
    <behavior name="MDS_Service.LoginAspNetAjaxBehavior">
      <webHttp helpEnabled="true"/>
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="MyServiceBehavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
      <serviceThrottling maxConcurrentCalls="100" maxConcurrentInstances="100" maxConcurrentSessions="100" />
    </behavior>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>   
</system.serviceModel>
我猜上面的错误是因为
仅用于webHttp绑定

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.Store">  
    <endpoint address="ms" binding="basicHttpBinding"   contract="MCDThirdPartyService.IStore" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>    

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.address">
    <endpoint address="ws" binding="basicHttpBinding" contract="MCDThirdPartyService.Iaddress" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.Configuration">
    <endpoint address="ws" binding="basicHttpBinding" contract="MCDThirdPartyService.IConfiguration" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.Order">
    <endpoint address="ws" binding="basicHttpBinding" contract="MCDThirdPartyService.IOrder" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="0" aspNetCompatibilityEnabled="true"/>


 <behaviors>
  <endpointBehaviors>        
    <behavior name="MDS_Service.LoginAspNetAjaxBehavior">
      <webHttp helpEnabled="true"/>
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="MyServiceBehavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
      <serviceThrottling maxConcurrentCalls="100" maxConcurrentInstances="100" maxConcurrentSessions="100" />
    </behavior>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>   
</system.serviceModel>
现在我真正需要的是为basicHttpBinding启用帮助页面。如何实现

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.Store">  
    <endpoint address="ms" binding="basicHttpBinding"   contract="MCDThirdPartyService.IStore" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>    

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.address">
    <endpoint address="ws" binding="basicHttpBinding" contract="MCDThirdPartyService.Iaddress" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.Configuration">
    <endpoint address="ws" binding="basicHttpBinding" contract="MCDThirdPartyService.IConfiguration" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.Order">
    <endpoint address="ws" binding="basicHttpBinding" contract="MCDThirdPartyService.IOrder" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="0" aspNetCompatibilityEnabled="true"/>


 <behaviors>
  <endpointBehaviors>        
    <behavior name="MDS_Service.LoginAspNetAjaxBehavior">
      <webHttp helpEnabled="true"/>
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="MyServiceBehavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
      <serviceThrottling maxConcurrentCalls="100" maxConcurrentInstances="100" maxConcurrentSessions="100" />
    </behavior>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>   
</system.serviceModel>
这是我的密码

    <?xml version="1.0"?>
  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.Store">  
    <endpoint address="ms" binding="basicHttpBinding"   contract="MCDThirdPartyService.IStore" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>    

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.address">
    <endpoint address="ws" binding="basicHttpBinding" contract="MCDThirdPartyService.Iaddress" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.Configuration">
    <endpoint address="ws" binding="basicHttpBinding" contract="MCDThirdPartyService.IConfiguration" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.Order">
    <endpoint address="ws" binding="basicHttpBinding" contract="MCDThirdPartyService.IOrder" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="0" aspNetCompatibilityEnabled="true"/>


 <behaviors>
  <endpointBehaviors>        
    <behavior name="MDS_Service.LoginAspNetAjaxBehavior">
      <webHttp helpEnabled="true"/>
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="MyServiceBehavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
      <serviceThrottling maxConcurrentCalls="100" maxConcurrentInstances="100" maxConcurrentSessions="100" />
    </behavior>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>   
</system.serviceModel>

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.Store">  
    <endpoint address="ms" binding="basicHttpBinding"   contract="MCDThirdPartyService.IStore" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>    

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.address">
    <endpoint address="ws" binding="basicHttpBinding" contract="MCDThirdPartyService.Iaddress" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.Configuration">
    <endpoint address="ws" binding="basicHttpBinding" contract="MCDThirdPartyService.IConfiguration" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.Order">
    <endpoint address="ws" binding="basicHttpBinding" contract="MCDThirdPartyService.IOrder" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="0" aspNetCompatibilityEnabled="true"/>


 <behaviors>
  <endpointBehaviors>        
    <behavior name="MDS_Service.LoginAspNetAjaxBehavior">
      <webHttp helpEnabled="true"/>
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="MyServiceBehavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
      <serviceThrottling maxConcurrentCalls="100" maxConcurrentInstances="100" maxConcurrentSessions="100" />
    </behavior>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>   
</system.serviceModel>


在用户端提供帮助,而不是在客户端启用帮助页面?但我的想法是,我这边需要帮助页面。有可能吗?我不这么认为,但您可以启用跟踪和消息日志记录。但是跟踪和消息日志记录不会提供API列表,而是在您的消费者端提供帮助功能。您是说在客户端启用帮助页面?但我的想法是,我这边需要帮助页面。有可能吗?我不这么认为,但你可以启用跟踪和消息记录。但是跟踪和消息记录不会给出API列表
  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.Store">  
    <endpoint address="ms" binding="basicHttpBinding"   contract="MCDThirdPartyService.IStore" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>    

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.address">
    <endpoint address="ws" binding="basicHttpBinding" contract="MCDThirdPartyService.Iaddress" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.Configuration">
    <endpoint address="ws" binding="basicHttpBinding" contract="MCDThirdPartyService.IConfiguration" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>

  <service behaviorConfiguration="MyServiceBehavior" name="MCDThirdPartyService.Order">
    <endpoint address="ws" binding="basicHttpBinding" contract="MCDThirdPartyService.IOrder" behaviorConfiguration="MDS_Service.LoginAspNetAjaxBehavior" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="0" aspNetCompatibilityEnabled="true"/>


 <behaviors>
  <endpointBehaviors>        
    <behavior name="MDS_Service.LoginAspNetAjaxBehavior">
      <webHttp helpEnabled="true"/>
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="MyServiceBehavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
      <serviceThrottling maxConcurrentCalls="100" maxConcurrentInstances="100" maxConcurrentSessions="100" />
    </behavior>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>   
</system.serviceModel>