【发布时间】:2018-03-05 06:17:19
【问题描述】:
我有一个BasicHttpBinding WCF 服务。我想在请求标头中获取用户名和密码。我在互联网上搜索了这个,但我只看到WSHttpBinding。我想要这样的东西:
//WCF client call
WCFTestService.ServiceClient myService = new
WCFTestService.ServiceClient();
myService.ClientCredentials.UserName.UserName = "username";
myService.ClientCredentials.UserName.Password = "p@ssw0rd";
MessageBox.Show(myService.GetData(123));
myService.Close();
但我不知道我应该为服务器端写什么?
谢谢
【问题讨论】:
标签: c# wcf c#-4.0 request-headers basichttpbinding