WCFサービスSecurityNegotiationException
質問
私の走り簡単にサービスに私のサーバWCF;サービスの開催WebDev.WebServer.exe (地方).
呼び出しサービス現地取得し、以下の例外:
独自のレンダリングメカニズムの例外:システム。ServiceModel.ます。SecurityNegotiationException:セキュアなチャネルが開かないので安全保障との交渉-リモートエンドポイントに失敗しました。これにより欠席または正しく指定されEndpointIdentityのEndpointAddressを作成するのに使用されます。をお確かめの上おかけ下さいEndpointIdentity指定され又は黙示のEndpointAddressを正しく認識、リモートエンドポイント--->のシステム。ServiceModel.FaultException:メッセージのアクション"http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue されません 加工の受信機により、ContractFilterミスマッチのEndpointDispatcher.この のいずれかの契約のミスマッチ(一致しない行間での送り手と受け手または結合/セキュリティミスマッチに送ります。ることを確認送信者と受信機が同じ契約と同じ結合を含むセキュリティ要件などメッセージ、輸送、なし).
ここでの私の二つのアプリです。設定ファイルからクライアントとサーバーです。作成したアプリです。configクライアントからのsvcutil-ツールでなければならないと考えておright:
お客様
<client>
<endpoint address="http://localhost:1634/UsuarioContexto.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IUsuarioContexto"
contract="CarWin.ServiceContracts.Interfaces.IUsuarioContexto" name="LOCAL_WSHttpBinding_IUsuarioContexto">
<identity><dns value="localhost" /></identity>
</endpoint>
</client>
<binding name="WSHttpBinding_IUsuarioContexto" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" />
</security>
</binding>
サーバー
<services>
<service behaviorConfiguration="UsuarioContextoBehavior" name="UserContext.Host.UsuarioContexto">
<endpoint address="" binding="wsHttpBinding" bindingNamespace="http://CarWin" bindingConfiguration="wsHttpBinding_IUsuarioContexto"
contract="CarWin.ServiceContracts.Interfaces.IUsuarioContexto">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="wsHttpBinding_IUsuarioContexto" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647" maxBytesPerRead="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<security mode="None">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="UsuarioContextoBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
解決
問題は、サーバーにあった、私はモードを置く=「メッセージ」とうまく動作します。感謝ます。
<security mode="None">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" establishSecurityContext="true" />
</security>
他のヒント
WCFは非常に強い力ができるコンフィグの悪夢です。ここにはある:
- をonにし、WCF跡ログ、再御シナリオのストレージエンジンはインデックログとしてSvcTraceViewer.exe
- どのメールが...
- すなわちは、お客様の要求に送ってサーバーを拒否である"下WCF層の前にご自分のサービスコードがヒット);
- 又は請求の取得を停止し、そのトラックの前に..のお客様なリクエストを送信する
- http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue はWS-信頼のトークン関連のメッセージしているわけではありあませんものとなっている認証
- 誤差の範囲内で一致するがコンフィグのミスマッチが使用SvcUtilべて並べようと言ってました
- 顧客との結合はサーバー"http://localhost:1634/UsuarioContexto.svc"
- きというものはないと思いるポートで指定されたサービスをconfig...サービスとはなにを聴いた。
- 場合はブラウザの目的について、それぞれのURLがいいデフォルトのサービスのページに表示すべき事は何か?