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....
});
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.
精彩评论