添加Wcf服务出错,请高手帮忙
WcfHost配置文件如下
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<services>
<service name="SmUsLoginServices" behaviorConfiguration="SmUsLoginServicesBehavior">
<host>
<baseAddresses>
<add baseAddress="net.Tcp://localhost:8731/TestSuiteClient/Wcf/SmUsLoginServices"/>
</baseAddresses>
</host>
<!-- Service Endpoints -->
<endpoint address="" binding="netTcpBinding" contract="TestSuiteClient.WcfServicesLib.SmUsLoginServices">
<!--
Upon deployment, the following identity element should be removed or replaced to reflect the
identity under which the deployed service runs. If removed, WCF will infer an appropriate identity
automatically.
-->
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="SmUsLoginServicesBehavior">
<!-- 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>
</system.serviceModel>
</configuration>
添加地址
net.Tcp://localhost:8731/TestSuiteClient/Wcf/SmUsLoginServices/mex
错误信息如下
元数据包含无法解析的引用:“net.tcp://localhost:8731/TestSuiteClient/Wcf/SmUsLoginServices/mex”。
无法连接到 net.tcp://localhost:8731/TestSuiteClient/Wcf/SmUsLoginServices/mex。连接尝试持续了 00:00:00.9531250 时间跨度。TCP 错误代码 10061: 由于目标机器积极拒绝,无法连接。 127.0.0.1:8731。
由于目标机器积极拒绝,无法连接。 127.0.0.1:8731
如果该服务已在当前解决方案中定义,请尝试生成该解决方案,然后再次添加服务引用。 WCF 引用 --------------------编程问答-------------------- 服务就发布在本机? --------------------编程问答-------------------- 同样问题,求大神解答,~~~· --------------------编程问答-------------------- 对的 服务器就在本机 --------------------编程问答--------------------
对的 服务器就在本机 --------------------编程问答-------------------- 你把baseAddress换一下http://localhost:8731/TestSuiteClient/Wcf/SmUsLoginServices/mex --------------------编程问答-------------------- 先理解每个节点的意思再仔细分析了,具体看看这个博客:http://www.cnblogs.com/weichuo/archive/2008/07/09/1238979.html
补充:.NET技术 , C#