2009-04-02 20 views
3

WCF Proxyと同じ問題かもしれませんが、わかりません...HTTPSエンドポイントを持つWCFサービスのクライアントプロキシを生成するにはどうすればよいですか?

私はHTTPSサービスを使用してトランスポートセキュリティと、Windows資格情報を使用しています。このサービスは、内部的に(すなわち、イントラネット内で)アクセスされるだけである。設定は次のとおりです。

<configuration> 
    <system.serviceModel> 
    <services> 
     <service name="WCFTest.CalculatorService" behaviorConfiguration="WCFTest.CalculatorBehavior"> 
     <host> 
      <baseAddresses> 
      <add baseAddress = "https://localhost:8000/WCFTest/CalculatorService/" /> 
      </baseAddresses> 
     </host> 
     <endpoint address ="basicHttpEP" binding="basicHttpBinding" contract="WCFTest.ICalculatorService" bindingConfiguration="basicHttpBindingConfig"/>  
     <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/> 
     </service> 
    </services> 
    <bindings> 
     <basicHttpBinding> 
     <binding name="basicHttpBindingConfig"> 
      <security mode="Transport"> 
      <transport clientCredentialType = "Windows"/> 
      </security> 
     </binding> 
     </basicHttpBinding> 
    </bindings> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="WCFTest.CalculatorBehavior">   
      <serviceAuthorization impersonateCallerForAllOperations="false" principalPermissionMode="UseWindowsGroups" /> 
      <serviceCredentials > 
      <windowsAuthentication allowAnonymousLogons="false" includeWindowsGroups="true" /> 
      </serviceCredentials> 
      <serviceMetadata httpsGetEnabled="True"/> 
      <serviceDebug includeExceptionDetailInFaults="False" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 
</configuration> 

サービスを実行すると、IEでサービスが表示されません。私は "このページは表示できません"というエラーが表示されます。

There was an error downloading ' https://localhost:8000/WCFTest/CalculatorService/ '. There was an error downloading ' https://localhost:8000/WCFTest/CalculatorService/ '. The underlying connection was closed: An unexpected error occurred on a send. Authentication failed because the remote party has closed the transport stream. Metadata contains a reference that cannot be resolved: ' https://localhost:8000/WCFTest/CalculatorService/ '. An error occurred while making the HTTP request to https://localhost:8000/WCFTest/CalculatorService/ . This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server. The underlying connection was closed: An unexpected error occurred on a send. Authentication failed because the remote party has closed the transport stream. If the service is defined in the current solution, try building the solution and adding the service reference again.

私はここにいくつかの基本的な基礎知識が不足していると思う:私は試してみて、「サービスの参照を追加」ウィザードを経由してVS2008でのクライアントを作成した場合、私はこのエラーを取得します。いくつかの証明書を設定する必要がありますか?それとも、NetTcpBindingを使用したときのように機能するのでしょうか?

おかげ

+0

あなたはクライアントの設定を投稿できますか? –

+0

受け入れているウィンドウグループを制限する方法がわかりません。 WindowsグループとActive Directoryグループには違いがありますか? – ng5000

+0

私はまだクライアントを持っていません。私はちょうど "Add Service Reference"に行くことができますが、それは私のための設定を作成するでしょう。 – ng5000

答えて

-1

変更

<endpoint address ="basicHttpEP" binding="basicHttpBinding" contract="WCFTest.ICalculatorService" bindingConfiguration="basicHttpBindingConfig"/> 

<endpoint address ="basicHttpEP" binding="basicHttpsBinding" contract="WCFTest.ICalculatorService" bindingConfiguration="basicHttpBindingConfig"/> 
+0

[basicHttpsBinding](http://msdn.microsoft.com/en-us/library/system.servicemodel.basichttpsbinding(v = vs.110).aspx)は、.NET 4.5でのみ使用できます。 – BladeWise

0

ng5000、

は、あなたが(多分IIS)ここでは別の問題を有していても良いように思えます。トランスポートレベルのセキュリティに問題はありますか?また、WCFの内容を確認する前にIEのWebアドレスにアクセスできることを確認します。セキュリティタブで正しくないIIS設定のように聞こえます。

トランスポートレベルのセキュリティをオフにしてプロキシを作成してから、両方の設定をトランスポートレベルのセキュリティに変更し、何が起こるかを確認してください。

-Bryan

+0

私はIISを使用していない、私は小さなコンソールアプリケーションで自己ホスティングしている。 – ng5000

0
... 
<security defaultAlgorithmSuite="Default" authenticationMode="IssuedTokenOverTransport" 
        requireDerivedKeys="false" securityHeaderLayout="Strict" includeTimestamp="true" 
        keyEntropyMode="CombinedEntropy" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"> 
        <issuedTokenParameters keyType="SymmetricKey" tokenType="" /> 
... 

にここに私の回避策があります。私は設定ファイルの上にあり、 "IssuedTokenOverTransport"から "UserNameOverTransport"にauthenticationModeを変更しました。私の環境上の問題を解決しました。

関連する問題