日期:2014-5-20 浏览次数:20216次 点赞次数:20

WCF 添加服务引用
配置如下
<system.serviceModel>
    <services>
      <service name="School.Wcf.Service.StudentService">
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:8866"/>
          </baseAddresses>
        </host>

        <endpoint
           address="net.tcp://localhost:8866/StudentService"
            binding="netTcpBinding"
            contract="School.Wcf.Contract.IStudentService"
          />
      </service>
    </services>
  </system.serviceModel>

用控制台程序托管 已经启动
然后我 在VS2010中右击 添加服务引用 
net.tcp://localhost:8866/StudentService  输入这个
找不到 好纠结

怎么添加?
------解决方案--------------------
没有发布METADATA

------解决方案--------------------
  <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
在HOST里面添加一条新的地址为HTTP格式,可以通过HTTP地址来获取服务。