[英]Can`t connect to WCF service from outside of my local network
I am learning to write WCF services and I wrote my simple service going step by step with example from book I am reading. 我正在学习编写WCF服务,并通过阅读的书中的示例逐步编写了简单的服务。 Service works fine on my PC and every device connected to my LOCAL network.
服务在我的PC以及连接到我的本地网络的所有设备上均能正常运行。 When I try to connect from "outside" of my local network if fails to see service (both via client app I wrote and via browser(MEX)).
当我尝试从本地网络的“外部”连接时,如果看不到服务(通过我编写的客户端应用程序和浏览器(MEX)),则无法访问。
My host app.config: 我的主机app.config:
<system.serviceModel>
<services>
<service name="WCF_1_MagicEightBallService.MagicEightBallService"
behaviorConfiguration="MagicEightBallServiceMEXBehavior">
<endpoint address=""
binding="basicHttpBinding"
contract="WCF_1_MagicEightBallService.IMagicEightBall">
</endpoint>
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange">
</endpoint>
<host>
<baseAddresses>
<add baseAddress="http://[my ip]:8080/MagicEightBallService"/>
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MagicEightBallServiceMEXBehavior">
<serviceMetadata httpGetEnabled="true"/>
<useRequestHeadersForMetadataAddress/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
My ip is my external ip, but I have tried using ip with and without using wifi router and with different ports. 我的ip是我的外部ip,但是我尝试使用带和不带wifi路由器以及不同端口的ip。
So, as mentioned Cameron in the comments, problem was with ISP blocking my ports. 因此,正如Cameron在评论中提到的那样,问题在于ISP阻止了我的端口。 This answer might be a little bit off topic, but for everyone with similar problem, here what I did:
这个答案可能与主题无关,但是对于每个有类似问题的人,我在这里做了以下工作:
It worked and I could get remote access via my external IP address. 它起作用了,我可以通过我的外部IP地址进行远程访问。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.