您的位置:首页 > 其它

##WCF配置

2016-01-15 09:45 405 查看
最近项目使用wcf技术开发,觉得应该将配置文件记录下来:

服务器端配置

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service behaviorConfiguration="MyServiceBehavior" name="Database.OracleDatabaseService">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="binding" contract="Database.IDatabaseService"/>
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:16015/Service/Database"/>
</baseAddresses>
</host>
</service>
<service behaviorConfiguration="MyServiceBehavior" name="Machine.DownloadService">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="binding" contract="Machine.IDownloadService"/>
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:16016/Service/Download"/>
</baseAddresses>
</host>
</service>
</services>

<behaviors>
<serviceBehaviors>
<behavior name="MyServiceBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
<serviceMetadata/>
<serviceDebug includeExceptionDetailInFaults="True"/>
</behavior>
</serviceBehaviors>
</behaviors>

<bindings>
<netTcpBinding>
<binding name="binding" sendTimeout="00:10:00" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647" maxBufferSize="2147483647">
<security mode="None">
</security>
</binding>
</netTcpBinding>
</bindings>
</system.serviceModel>

<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>


客户端配置文件

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="ServiceBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
</endpointBehaviors>
</behaviors>

<bindings>
<netTcpBinding>
<binding name="ServiceBinding" sendTimeout="00:03:00" maxBufferPoolSize="2147483647"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>

<client>
<endpoint address="net.tcp://localhost:16015/Service/Database" name="Database" binding="netTcpBinding"
bindingConfiguration="ServiceBinding" contract="Ehl.ATMOS.TCS.JR.DB.DbBusiness.IDatabaseService" />

<endpoint address="net.tcp://localhost:16016/Service/Download" name="Download" binding="netTcpBinding"
bindingConfiguration="ServiceBinding"  contract="Ehl.ATMOS.TCS.JR.InteracteOper.ServiceClients.IDownloadService"  />
</client>
</system.serviceModel>

<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
</configuration>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  wcf 配置文件