WCF配置Tcp协议

注意点:

1,<serviceMetadata httpGetEnabled="false"/>  

2, 

      <services>
        <service behaviorConfiguration="MyBehavior" name="WcfService1.Service1">
          <host>
            <baseAddresses>
              <add baseAddress="net.tcp://localhost:8001/"/>
            </baseAddresses>
          </host>
          <endpoint address="S1" binding="netTcpBinding" bindingConfiguration="MyTcpBinding" contract="WcfService1.IService1"></endpoint>
          <endpoint address="S2" binding="netTcpBinding" bindingConfiguration="MyTcpBinding" contract="WcfService1.IService1"></endpoint>        
          <endpoint address="mex111" binding="mexTcpBinding" contract="IMetadataExchange" /><!--这个是必须的-->
        </service>
      </services> 

3,引用地址为:net.tcp://localhost:8001/mex111(可以右键引用的上服务修改那个地址)

4,源码下载 

posted @ 2014-02-08 11:31  pnljs  阅读(3765)  评论(0编辑  收藏  举报