我尝试构建一个应用程序,根据本文使用WCF在2台机器之间发送消息:http://www.youtube.com/watch?v=1-BYIQQYwjQ
完成所有步骤后,当服务器和客户端在同一台机器上运行时,一切正常。
将我的客户端(简单控制台应用程序)移动到另一台计算机时,我已将 localhost 从http://localhost:8733/MySampleWCFService/
更改为我的计算机IP address
(同一网络中的两台计算机都没有运行防火墙但是收到了错误
没有端点监听
这是我的App.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation debug="true" />
</system.web>
<!-- When deploying the service library project, the content of the config file must be added to the host's
app.config file. System.Configuration does not support config files for libraries. -->
<system.serviceModel>
<services>
<service name="WCFServiceHostingInWinService.MySampleWCFService">
<endpoint
name="ServiceHttpEndPoint"
address=""
binding="basicHttpBinding"
contract="WCFServiceHostingInWinService.IMySampleWCFService">
</endpoint>
<endpoint
name="ServiceMexEndPoint"
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8733/MySampleWCFService/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information,
set the value below to false before deployment -->
<serviceMetadata httpGetEnabled="True"/>
<!-- To receive exception details in faults for debugging purposes,
set the value below to true. Set to false before deployment
to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="True" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
也许这可能是权限问题?