2012-04-19 14 views
1

1つのwsHttp(SOAP)と2つのwebHttp(REST)バインディングを持つIIS6(および開発環境では7)でホストされているWCFアプリケーションがあります。IIS(6)のWCF + SSL/HTTPS。 web.configでHTTPアクセスを無効にする方法は?

プロダクションサイトに公開する際にサービスを保護し、メタデータとwebHttpヘルプページとENABLE SSLをバインディングに使用不可にしたいとします。同時に私はHTTPを無効にしたいと思っています。私はIISの "安全なチャンネルを要求する"オプションを認識していますが、同じことがweb.configで達成できるかどうか疑問に思っていましたか?

私はその

<security mode="Transport">

印象の下になり、 "無効" のhttpアクセス(すなわち。HTTPS必須)だったが、私の場合には、それはしませんでした。

彼女は、web.configファイルのServiceModelの一部です:

<system.serviceModel> 
<bindings> 
    <wsHttpBinding> 
    <binding name="SoapTransportSecurityBinding"> 
     <security mode="Transport"> 
     <transport clientCredentialType="None"/> 
     <message establishSecurityContext="false"/> 
     </security> 
    </binding> 
    </wsHttpBinding> 
    <webHttpBinding> 
    <binding name="RestTransportSecurityBinding"> 
     <security mode="Transport"> 
     <transport clientCredentialType="None"/> 
     </security> 
    </binding> 
    </webHttpBinding> 
</bindings> 
<services> 
    <service name="CustomerWcfService" behaviorConfiguration="Web.ServiceBehavior"> 
    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="SoapTransportSecurityBinding" contract="ICustomerWcfService"> 
     <identity> 
     <dns value="ws.somecompany.com"/> 
     </identity> 
    </endpoint> 
    </service> 
    <service name="SentShipmentsWcfRestService" behaviorConfiguration="webHttpServiceBehavior"> 
    <endpoint address="" binding="webHttpBinding" bindingConfiguration="RestTransportSecurityBinding" contract="ISentShipmentsWcfRestService" 
     behaviorConfiguration="RestEndpointBehavior"/> 
    </service> 
    <service name="InsuranceInfoWcfRestService" behaviorConfiguration="webHttpServiceBehavior"> 
    <endpoint address="" binding="webHttpBinding" bindingConfiguration="RestTransportSecurityBinding" contract="IInsuranceInfoWcfRestService" 
     behaviorConfiguration="RestEndpointBehavior"/> 
    </service> 
</services> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="Web.ServiceBehavior"> 
     <serviceDebug includeExceptionDetailInFaults="false"/> 
    </behavior> 
    <behavior name="webHttpServiceBehavior"> 
     <serviceDebug includeExceptionDetailInFaults="false"/> 
    </behavior> 
    </serviceBehaviors> 
    <endpointBehaviors> 
    <behavior name="RestEndpointBehavior"> 
     <webHttp helpEnabled="false"/> 
    </behavior> 
    </endpointBehaviors> 
</behaviors> 

答えて

0

それはそれはweb.configファイルで達成することができなかったに見えます。必要な一切SSLがない場合しかし、あなたはこの場合

 <security mode="Transport"> 

を設定することができますバインド設定でエンドポイントは無効になります。

+0

ありがとうございますが、私はすでにセキュリティモードを持っています。バインディングには "Transport"が設定されています。私も、これがhttpアクセスを "無効にする"という印象を受けましたが、私の場合はそうしませんでした。 (これは私の質問を編集したので、これはもっと明白です)。 – Trygve

関連する問題