开发者

How to hide my WCF service URL path

开发者 https://www.devze.com 2023-01-27 06:44 出处:网络
I have a WCF service hosted on IIS and it accepts connection like this http://host/myservice.svc/GetCount?method=?,

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号