0

我希望能够同时使用 http 和 https 访问服务

在地址“安全”的端点上,如果我包含 bindingConfiguration 属性,我会得到一个 ServiceActivationException。

但如果我删除 bindingConfiguration="webBindingSecure",一切正常。bindingConfiguration 有什么问题?

<system.serviceModel>
<services>
  <service name="OperatorApp.Api" behaviorConfiguration="ServiceBehaviour">
    <endpoint address="secure" binding="webHttpBinding" **bindingConfiguration="webBindingSecure"**  contract="OperatorApp.IApi" behaviorConfiguration="ssl" />

  <endpoint address="normal" binding="webHttpBinding"   contract="OperatorApp.IApi" behaviorConfiguration="web" />
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="ServiceBehaviour">
     <serviceMetadata httpGetEnabled="true"  httpsGetEnabled="true" >
     </serviceMetadata>
    <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="web">
      <webHttp />
    </behavior>
  <behavior name="ssl">
    <webHttp/>
  </behavior>
  </endpointBehaviors>
</behaviors>
<bindings>
  <webHttpBinding>
    <binding name="webBindingSecure">
      <security mode="Transport">
      </security>
    </binding>
  </webHttpBinding>
</bindings>

4

0 回答 0