The caller was not authenticated by the service.
У меня есть служба WCF, размещенная в службе Windows на одном компьютере, и у меня есть другая служба Windows на другом компьютере в качестве клиента, подключающегося к службе WCF на первом компьютере.Я предполагаю, что это как-то связано с безопасностью, но я не уверен, что делать.Вот app.config клиента:
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IWCFService" 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">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<reliableSession ordered="true" inactivityTimeout="00:10:00"/>
<security mode="Message">
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default"/>
</security>
</binding>
</wsDualHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8731/Design_Time_Addresses/WCF/WCFService/"
binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IWCFService"
contract="WCFService.IWCFService" name="WSDualHttpBinding_IWCFService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
</client>
</system.serviceModel>
И app.config службы:
<system.serviceModel>
<services>
<service name="WCF.WCFService" behaviorConfiguration="WCFBehavior">
<endpoint address="" binding="wsDualHttpBinding" contract="WCF.IWCFService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint
address="mex"
binding="mexHttpBinding"
bindingConfiguration=""
contract="IMetadataExchange"/>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8731/Design_Time_Addresses/WCF/WCFService/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="WCFBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
Что мне нужно сделать, чтобыбыть в состоянии подключиться к моей службе WCF.
Еще одна вещь, которую стоит отметить, - я создал простое консольное приложение в качестве клиента для службы wcf, и оно может без проблем подключаться к службе и приложению.Конфигурационный файл выглядит идентично.Может быть, это как-то связано с тем, что клиентская служба работает от имени другого пользователя?Я в порядке, удалив все и вся безопасность, но не знаю как.