4

次にシナリオです。

F5 ロード バランサーがあり、着信要求は HTTP として F5 ロード バランサーに到着し、HTTP として WCF サービス サーバーにリダイレクトされます。

考えられるほとんどすべての構成の組み合わせを試しましたが、2 つの異なるエラーが発生し続けます。たとえば、いくつかの提案に照らして、セキュリティ モードを「トランスポート」に変更しようとしたところ、エラーが次のように変わりました。 ."

サーバー構成:

<system.serviceModel>
    <services>
      <service behaviorConfiguration="NameofServiceBehaviour" name="NameOfServices">
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsHttpEndPointBinding" name="wsHttpEndPoint" contract="Name.IContractName" />
      </service>
    </services>
    <bindings>
      <wsHttpBinding>
        <binding name="wsHttpEndPointBinding">
          <security mode="None"> 
        <!-- <transport clientCredentialType="Certificate" /> -->
      </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehaviourName">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
          <!-- <serviceCredentials>
            <serviceCertificate findValue="CN=CertificateName" storeLocation="LocalMachine" />
          </serviceCredentials> -->
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="false" />
  </system.serviceModel>

クライアント構成:

<system.serviceModel>
        <bindings>
            <wsHttpBinding>
                <binding name="wsHttpEndPoint">
                    <security mode="None" />
                </binding>
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint address="https://URL.svc"
                binding="wsHttpBinding" bindingConfiguration="wsHttpEndPoint"
                contract="Name.IContractName" name="wsHttpEndPoint" />
        </client>
    </system.serviceModel>

よろしく、 ナシル

4

2 に答える 2

5

Load Balancer の下でこの問題が発生し、修正は次のようにクライアント側で行われました。

<system.serviceModel>        
    <bindings>
      <customBinding>
        <binding name="MyBindingConfig">
          <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" messageVersion="Soap11" writeEncoding="utf-8">
          </textMessageEncoding>
          <httpsTransport  authenticationScheme="Anonymous" bypassProxyOnLocal="false" proxyAuthenticationScheme="Anonymous"/>
        </binding>
      </customBinding>
    </bindings> 
    <client>
        <endpoint address="https://YOUR-END-POINTURL-WITH-HTTPS"
            binding="customBinding" bindingConfiguration="MyBindingConfig"
            contract="ServiceReference.YOURCONTRACT" name="TEST" />
    </client>
</system.serviceModel>

また、VisualStudio に webservice 参照を追加し、HTTPS を使用して URL を配置すると、S なしでクライアント エンドポイントの子 (client app.config) に URL が自動的に追加されることがわかります (HTTP はロードバランサーのため)。上記の例で行ったように、先に進んで HTTPS で更新できます。それが役立つことを願っています。

于 2016-04-19T19:49:07.810 に答える