WCF在局域网上不起作用 [英] WCF not working on LAN
本文介绍了WCF在局域网上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨..
我已经在WCF中编写了一个程序.客户端将数据发送到主机的位置.当我在同一台PC上运行主机和服务器时,它工作得很好
我的服务器端是
Hi..
I''ve made a program in WCF. Where client send data to host. It is working perfectly whenI run host and server on same pc
my server side is
host.AddServiceEndpoint(typeof(IHelloService), binding, new Uri("http://localhost:9000"));
host.Open();
我的客户是
my client side is
var cli = new ChannelFactory<ihelloservice>(new BasicHttpBinding(), new EndpointAddress("http://localhost:9000"));
var ch = cli.CreateChannel();
</ihelloservice>
但是当我尝试在LAN上使用它时不起作用.我将主机PC ip放在locathost上,但是我却不起作用...
请帮助
but when I tried to use that on LAN it doesn''t work.I put my host pc ip at locathost but i didn''t work...
please help
推荐答案
您正在告诉您的客户端,您的服务位于客户端PC上的http://localhost:9000上.
您必须更正客户中的地址,例如. http://192.168.1.100:9000
You''re telling your client that your service is located at http://localhost:9000 meaning on the client PC.
you have to correct the address in your client, eg. http://192.168.1.100:9000
这篇关于WCF在局域网上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文