WCF在本地但不是远程工作

时间:2010-11-24 23:54:13

标签: .net wcf

我正在使用BasicHttpBinding,服务主机为http://networkip:5678而我只是试图独立托管,我没有使用IIS ......

let host = new ServiceHost(typeof<MyService>, [|new Uri("http://192.168.100.131:5678/")|])

let behavior = new ServiceMetadataBehavior()

behavior.HttpGetEnabled <- true
host.Description.Behaviors.Add(behavior)
let bind = new BasicHttpBinding()
bind.HostNameComparisonMode <- HostNameComparisonMode.StrongWildcard
host.AddServiceEndpoint(typeof<CQGService>, bind, "MyService") |> ignore
host.AddServiceEndpoint(typeof<IMetadataExchange>, bind, "MEX") |> ignore

host.Open()

它在本地计算机上运行良好,但网络上没有人可以看到它...我看到另一个帖子要求运行netstat所以我做了,我可以看到它在0.0.0.0:5678上收听。有什么我想念的吗?

1 个答案:

答案 0 :(得分:0)

仔细检查确保您没有阻止该端口的防火墙