我已经使用wsHttpBinding和Message安全性创建了一个WCF服务.然后我添加了一个服务引用,导致客户端的配置文件更新为:
<client>
<endpoint address="http://localhost:42160/Service1.svc/secure"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService1"
contract="SecureProxy.IService1" name="WSHttpBinding_IService1">
<identity>
<userPrincipalName value="baria2@mydomain.com" />
</identity>
</endpoint>
</client>
Run Code Online (Sandbox Code Playgroud)
我不明白userPrincipalName的用途.无论我将值修改为什么,客户端和服务都能成功通信.它似乎没有任何用途.
这篇MSDN文章试图详细解释目的,并以某种方式设法解释任何内容.
微软试图通过将其添加到WCF故事中来解决什么问题?同样,我可以将值更改为我想要的任何值,它不会影响客户端和服务.
此外,这是一个类似的问题.
Mat*_*eis -1
默认情况下,当服务配置为使用 Windows 凭据时,会生成<identity>and元素。<userPrincipalName>