我们在WinForm项目中添加服务引用后会在App.config文件中添加如下内容:
1 23 4 155 96 87 10 1413
这样做虽然能够调用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());