wsHttpBindingとそれを呼び出すクライアントを使用するWCFサービスを構築しました。
しかし、それでも次のエラーメッセージが表示されます。
An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.
内部の例外は次のとおりです。
An error occurred when processing the security tokens in the message.
これがサービスの設定ファイルです:
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="myWsBinding">
<security>
<message negotiateServiceCredential="false" algorithmSuite="Basic128"
establishSecurityContext="false" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="ServiceBehavior" name="HelloWorldService.HelloService">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="myWsBinding"
contract="HelloWorldService.IHelloService">
<identity>
<servicePrincipalName value="host/MAGBAREYA"/>
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8999/myService" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
クライアント設定ファイルは次のとおりです。
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IHelloService">
<security mode="Message">
<message clientCredentialType="Windows" negotiateServiceCredential="false"
algorithmSuite="Basic128" establishSecurityContext="false" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8999/myService" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IHelloService" contract="ServiceReference1.IHelloService"
name="WSHttpBinding_IHelloService">
<identity>
<servicePrincipalName value="host/MAGBAREYA"/>
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
問題のある構成は、negotiateServiceCredential="false"です。
サービスとクライアントの両方でtrueに設定すると、クライアントは完全に機能します(この変更を除いて、上記の構成ファイルを使用します)
誰かが私がここで何が恋しいのか教えてもらえますか?
前もって感謝します。