【发布时间】:2012-03-27 17:28:56
【问题描述】:
我有一个关于 WCF Web 服务安全性的问题。目前,我们正在开发一个 android 移动项目并使用 wcf Web 服务进行数据传输和操作。 我们使用 basicHttpBinding 并将 Web 服务托管为 Window Service。
我们目前没有任何安全模式,恐怕每个人知道服务地址就可以使用我们的网络服务。 例如,我们有一个服务方法,它将返回字符串值。目前,我可以将该服务添加到其他 Visual Studio 项目和移动项目中,我们可以随时使用。
//WCF Service Method
public string DoWork()
{
return "This is return string!";
}
//We can consume it like below from other dot net project by adding service reference.
//Actually, those are not real client.
ServiceReference1.WebServiceClient serv = new TestingPrj.ServiceReference1.WebServiceClient();
string result = serv.DoWork();
我的问题是如何为真实客户保护我的网络服务?我不希望其他项目和人员使用我们的网络服务。
【问题讨论】:
-
我已经尝试过了,但大多数答案都是针对托管在 IIS 中的 Web 服务。这就是为什么我把问题放在这里。无论如何,谢谢你的帮助。
标签: wcf web-services wcf-security wcf-client