wcf 发布问题(iis 宿主)
WCF部署到服务器上,在客户端浏览器里访问如下地址
http://192.x.x.x/mobilephone/service.svc
可以正常访问,页面返回
svcutil.exe http://计算机名/MobilePhone/Service.svc?wsdl
在客户端程序调用服务的时候(添加服务引用,输入
http://192.x.x.x/mobilephone/service.svc 地址,点击【前往
】,会提示 无法远程访问 计算机名
请问如何解决,谢谢
----
Service.svc
<%@ ServiceHost language="c#" Debug="true" Service="IfaceService.ClassService" %>
----
web.config
<system.serviceModel>
<services>
<service behaviorConfiguration="ServiceBehavior" name="IfaceService.ClassService">
<endpoint address="basic" binding="basicHttpBinding" contract="IfaceService.InterfaceService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<!-- 为避免泄漏元数据信息,请在部署前将以下值设置为 false 并删除上面的元数据终结点 -->
<serviceMetadata httpGetEnabled="true"/>
<!-- 要接收故障异常详细信息以进行调试,请将以下值设置为 true。在部署前设置为 false 以避免泄漏异常信息-->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
----