wcf - 我的 UWP 应用如何使用 WCF 服务进行身份验证?

标签 wcf authentication win-universal-app wcf-security windows-10-universal

我正在用 C# 编写一个 UWP 应用程序,并尝试让它使用来自(预先存在的)WCF 服务的数据。我在网上找不到有关该主题的任何信息。我的代码如下所示(WCF 服务是 Serv,服务命名空间是 Ns):

var config = Ns.ServClient.EndpointConfiguration.BasicHttpBinding_IServ;
var client = new Ns.ServClient(config);
var result = client.TestCall();

我收到以下异常,我不明白如何解析:

Exception thrown: 'System.ServiceModel.Security.MessageSecurityException' in mscorlib.ni.dll

Additional information: The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate, NTLM'.

这个错误信息是什么意思?如何成功使用 WCF 服务进行身份验证?

额外问题:ServiceReferences.Designer.ClientConfig 文件是什么?我该如何使用它?

最佳答案

我打开了 Package.appxmanifest 文件并添加了企业身份验证专用网络(客户端和服务器)功能。这解决了问题。

关于wcf - 我的 UWP 应用如何使用 WCF 服务进行身份验证?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37667619/

相关文章:

wcf - 一段时间后(20 分钟)出现 WCF 服务超时

java - Spring Security Basic Authentication 总是导致 404

visual-studio-2013 - 在 Windows 通用应用程序的可视 Assets 文件中,scale-240 表示什么?

.net - 要添加哪些计数器 (PerfMon) 来查找 C# WCF Web 服务中的性能问题?

c# - WCF 数据限制

java - 如何让用户连续几个月登录我的网站?

c# - 等待 DeviceInformation.FindAllAsync(selector) 并引用 System.Runtime.WindowsRuntime 时出错

c# - NuGet AzureServiceBus 问题

WCF 客户端 - 为什么会出现此错误?

php - php 中的登录状态更新