0

webHttpバインディングWCFサービスにトランスポートレベルのセキュリティを設定しようとしています現在の構成は次のようになります

 <system.serviceModel>
<client>
  <endpoint binding="webHttpBinding" bindingConfiguration="webHttp"
    contract="PrimeStreamInfoServices.IService1" name="Client" />
</client>
<bindings>
<webHttpBinding>
  <binding name="webHttp" maxBufferPoolSize="1500000"  maxReceivedMessageSize="1500000"  maxBufferSize="1500000">
  <security mode="Transport">
      <transport clientCredentialType="None"

            proxyCredentialType="None"
            realm="string" />
  </security>
  </binding>

</webHttpBinding>
</bindings>
<services>

  <service name="PrimeStreamInfoServices.Service1" behaviorConfiguration="PrimeStreamInfoServices.Service1Behavior">
    <!-- Service Endpoints -->
    <endpoint address="" binding="webHttpBinding" bindingConfiguration="webHttp" contract="PrimeStreamInfoServices.IService1">
      <!-- 
          Upon deployment, the following identity element should be removed or replaced to reflect the 
          identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
          automatically.
      -->
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="PrimeStreamInfoServices.Service1Behavior">

      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="true"/>
      <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
<diagnostics>

  <messageLogging logMalformedMessages="true"  logMessagesAtServiceLevel="true"
    logMessagesAtTransportLevel="true" />

</diagnostics>

ただし、サービスを実行すると、例外が発生します。WebHttpBinding をバインドするエンドポイントのスキーム https に一致するベース アドレスが見つかりませんでした。登録されているベース アドレス スキームは [http] です。

私は何かが足りないことを知っています、そして私はそれを理解できないさまざまなことを試みてきました、誰かが私がしなければならないことについて何らかの意見を持っていますか

4

4 に答える 4

0

<host>https であるベースアドレス(サービス構成の要素内)を追加してみてください。コードに (または複数の) ベース アドレスを追加していますか?

<service name="PrimeStreamInfoServices.Service1" 
         behaviorConfiguration="PrimeStreamInfoServices.Service1Behavior">
   <host>
      <baseAddresses>
         <add baseAddress="https://localhost:8080/YourService.svc" />
      </baseAddresses>
   </host>
   <!-- Service Endpoints -->
   <endpoint ......
</service>

それが webHttpBinding で機能するかどうかは 100% わかりませんが、試してみてください!

マルク

于 2009-07-27T21:24:48.647 に答える
0

適切な WCF 構成に加えて、IIS プロパティを構成して SSL を有効にする必要があることに注意してください (SSL 用の適切な X.509 証明書の設定を含む)。ドキュメントには、それを行う方法に関するいくつかの適切な情報があります。

于 2009-07-28T00:16:11.243 に答える
0

はい - 適切な証明書を使用して HTTPS に切り替えます。HTTP の場合のトランスポート セキュリティは、SSL チャネルによって提供されます。プレーンな HTTPS で WS* トランスポート セキュリティを使用することはできません

于 2009-07-27T19:55:07.003 に答える
0

以前の回答は無視してください。webHttpBinding ではなく wHttpBinding を考えていました。

https で始まる必要があるサービスを呼び出すために使用するアドレスです。

https://マシン名/サービス名

于 2009-07-27T20:00:36.883 に答える