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,源碼下載 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM