博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
WinForm 调用WebService 隐藏服务器IP地址之真假美猴王~!O(∩_∩)O哈哈~
阅读量:7021 次
发布时间:2019-06-28

本文共 935 字,大约阅读时间需要 3 分钟。

 

  我们在WinForm项目中添加服务引用后会在App.config文件中添加如下内容:

  

1 
2
3
4
5
6
7
8
9
10
13
14
15

 

  这样做虽然能够调用WebService却将服务器的IP地址暴露给了客户端。

 

  那么如何解决呢,老夫夜观天象,掐指一算~!搞个真假美猴王吧~!

  

1             WindowsFormsApplication4.ServiceReference1.TestServiceClient testServiceClient = new TestServiceClient();2             testServiceClient.Endpoint.Address = new EndpointAddress("http://192.168.168.30:8080/WebTest/TestService");3             testServiceClient.Endpoint.Binding = new BasicHttpBinding();4             testServiceClient.Endpoint.ListenUri = new Uri("http://192.168.168.30:8080/WebTest/TestService");5             MessageBox.Show(testServiceClient.jia(1, 2).ToString());

 

转载于:https://www.cnblogs.com/bjxingch/articles/7269076.html

你可能感兴趣的文章
css学习笔记(2)
查看>>
如何看内核源码
查看>>
Caffe 安装 cannot find -lpython2 错误
查看>>
坑爹的matlab除法
查看>>
MySQL 安装方法
查看>>
WebApi接口传参不再困惑:传参详解
查看>>
类欧几里得算法
查看>>
java可变参数
查看>>
网络安全概论
查看>>
Quidway S系列交换机
查看>>
微服务
查看>>
Bootstrap3 代码-内联代码
查看>>
[转载] SQL进行排序、分组、统计的10个新技巧
查看>>
LeetCode-Flip Game II
查看>>
7天学会node
查看>>
Git 命令
查看>>
指数、对数以及根式的运算【初级中阶辅导】
查看>>
EXT中创建遮罩层的类LoadMask
查看>>
jupyter扩展插件Nbextensions使用
查看>>
Jav解析xml
查看>>