请教wcf访问问题。
本帖最后由 Shrek_MyCpp 于 2013-05-11 22:51:21 编辑 建立了一个ConsoleApplication1控制台程序,引用了WcfServiceLibrary1。
控制台程序放在远程电脑上运行。
然后在本地建立了一个工程,想引用远程的服务,为什么找不到???
是URL写的不对吗?
就是把控制台上的 宿主基地址的 LocalHost,改成该电脑的ip了。
请问问题出在哪里???
[解决办法]
有很多可能性,比如你是否使用了正确的绑定(http),是否正确部署,防火墙,等等。
[解决办法]
用控制台作为wcf的宿主的话
引用地址不是用http开头的
还有宿主的配置文件中也要添加貌似mexchange的一个节点
所以问题多多~
[解决办法]
楼上说的都有道理。
我学习WCF时也出现过引用不上的问题,当时是因为没有开启serviceMetadata 。
即你在配置文件中添加节点
<behaviors>
<serviceBehaviors>
<behavior name="WcfServiceApp.WCFServiceBehavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above 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="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<service name="WcfServiceApp.WCFService" behaviorConfiguration="WcfServiceApp.WCFServiceBehavior">