码迷,mamicode.com
首页 > Web开发 > 详细

【WCF】控制台程序实现WCF寄宿(http、net.tcp),相关配置文件

时间:2014-09-17 15:08:12      阅读:262      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   io   os   文件   div   sp   

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <netTcpBinding>
                <binding name="LoginServiceBinding" transactionFlow="true"/>
            </netTcpBinding>
        </bindings>
        <services>
            <service name="Bruce.WCFService.Service1" behaviorConfiguration="Bruce.WCFService.Service1Behavior">
                <host>
                    <baseAddresses>
                        <!--这里的IP配置地址可以随意,无验证-->
                        <add baseAddress = "http://192.168.1.188:82" />
                        <!--这里的IP地址必须是本机IP或localhost或127.0.0.1,注意端口,若被占则无法启动,局域网其他客户端机器访问时候则指定为该服务器的真实IP-->
                        <add baseAddress = "net.tcp://192.168.0.132:81" />
                    </baseAddresses>
                </host>
                <endpoint binding="basicHttpBinding" contract="Bruce.WCFService.IService1">
                </endpoint>
                <endpoint  binding="netTcpBinding" contract="Bruce.WCFService.IService1"></endpoint>
                <!--若以netTcpBinding,则必须加上以下代码-->
                <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
            </service>
        </services>
        <behaviors>
            <serviceBehaviors>
                <behavior name="Bruce.WCFService.Service1Behavior">
                    <serviceMetadata httpGetEnabled="True" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
    </system.serviceModel>
</configuration>

 

【WCF】控制台程序实现WCF寄宿(http、net.tcp),相关配置文件

标签:style   blog   http   color   io   os   文件   div   sp   

原文地址:http://www.cnblogs.com/BruceGoGo/p/3977036.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!