如何隐藏我的 WCF 服务 URL 路径
我有一个托管在 IIS 上的 WCF 服务,它接受这样的连接 http://host/myservice.svc/GetCount?method=?
,
我有一堆位于公共域上的 html 页面,将调用上述服务,无论如何都可以轻松查看 html 源代码并找出这些服务的 url。
所以我的问题是如何隐藏它以防止其他人查看 url 路径?
myservices.svc/GetCount?method=?
而不是定义整个路径
$("#btn").click(function (event) {
var url = 'http://host/myservice.svc/GetCount?method=?';
$.getJSON(url, { Id: '2' }, function (customer) {
//to do....
});
I have a WCF service hosted on IIS and it accepts connection like this http://host/myservice.svc/GetCount?method=?
,
i have bunch of html pages that sitting on the public domain and will be calling the above services and anyway could easily view the html source code and find out the url for those services.
so my question is how can i hide it from other other viewing the url path?
myservices.svc/GetCount?method=?
instead of defining the whole path
$("#btn").click(function (event) {
var url = 'http://host/myservice.svc/GetCount?method=?';
$.getJSON(url, { Id: '2' }, function (customer) {
//to do....
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您要从 javascript 调用此 Web 服务,则绝对不可能隐藏路径。无论你如何混淆它, FireBug 总是会显示请求,你甚至不需要查看源代码为了这。
It is absolutely impossible to hide the path if you are going to call this web service from javascript. No matter how much you obfuscate it, FireBug will always show the request and you don't even need to view the source code for this.