netTcpBinding 客户端和服务端配置文件
来源:互联网 发布:矢量网络分析仪端口 编辑:程序博客网 时间:2024/06/06 00:40
netTcpBinding 客户端配置文件
<?xml version="1.0" encoding="utf-8" ?><configuration> <system.serviceModel> <bindings> <netTcpBinding> <binding name="1ISMyTestBinding" maxReceivedMessageSize="1073741824" receiveTimeout="00:05:00" sendTimeout="00:05:00"> <security mode="None"> <transport clientCredentialType="None"/> </security> <readerQuotas maxStringContentLength ="1073741824" maxArrayLength ="1073741824" /> </binding> </netTcpBinding> </bindings> <client> <!--iis host for run--> <endpoint address="net.tcp://localhost:112/test.svc" binding="netTcpBinding" bindingConfiguration="1ISMyTestBinding" contract="Contract.IMyTest" name="TestEndpoint" /> </client> </system.serviceModel></configuration>
服务器配置文件
web.config
<?xml version="1.0" encoding="utf-8"?><configuration> <configSections> <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" /> <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> </sectionGroup> </sectionGroup> </sectionGroup> </configSections> <appSettings/> <connectionStrings/> <system.web> <!-- 设置 compilation debug="true" 可将调试符号插入 已编译的页面中。但由于这会 影响性能,因此只在开发过程中将此值 设置为 true。 --> <compilation debug="false"> <assemblies> <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> </assemblies> </compilation> <!-- 通过 <authentication> 节可以配置 ASP.NET 用来 识别进入用户的 安全身份验证模式。 --> <authentication mode="Windows" /> <!-- 如果在执行请求的过程中出现未处理的错误, 则通过 <customErrors> 节可以配置相应的处理步骤。具体说来, 开发人员通过该节可以配置 要显示的 html 错误页 以代替错误堆栈跟踪。 <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> <error statusCode="403" redirect="NoAccess.htm" /> <error statusCode="404" redirect="FileNotFound.htm" /> </customErrors> --> <pages> <controls> <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </controls> </pages> <httpHandlers> <remove verb="*" path="*.asmx"/> <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/> </httpHandlers> <httpModules> <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </httpModules> </system.web> <system.codedom> <compilers> <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <providerOption name="CompilerVersion" value="v3.5"/> <providerOption name="WarnAsError" value="false"/> </compiler> </compilers> </system.codedom> <!-- 在 Internet 信息服务 7.0 下运行 ASP.NET AJAX 需要 system.webServer 节。对早期版本的 IIS 来说则不需要此节。 --> <system.webServer> <validation validateIntegratedModeConfiguration="false"/> <modules> <remove name="ScriptModule" /> <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </modules> <handlers> <remove name="WebServiceHandlerFactory-Integrated"/> <remove name="ScriptHandlerFactory" /> <remove name="ScriptHandlerFactoryAppServices" /> <remove name="ScriptResource" /> <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> </handlers> </system.webServer> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> </dependentAssembly> </assemblyBinding> </runtime> <system.serviceModel> <services> <service name="Service.SMyTest" behaviorConfiguration="ServiceBehavior"> <host> <!--注意了--> <!--必须要有基地址 net.tcp,如果没有net基地址就不能有 http 基地址,否则报错--> <!--添加 http 基地址是为了方便调试,可在浏览器中浏览,也可获得元数据 【httpGetEnabled 必须为 true】--> <!--注意了--> <!--必须和 behaviorConfiguration 的属性 HttpGetEnable 配合使用--> <!--baseAddress 调试环境下可以根据情况设置--> <baseAddresses> </baseAddresses> </host> <!--终结点配置--> <!--address:服务地址 | binding:绑定类型(通信方式) | bindingConfiguration:服务终结点绑定配置名称 | contract:契约【即:命名空间.服务契约(服务接口)】--> <!--address, 根据生产环境实际情况设置--> <!--contract 根据不同应用程序设置--> <endpoint address="" binding="netTcpBinding" bindingConfiguration="ServiceBinding" contract="Contract.IMyTest"/> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> </service> </services> <behaviors> <serviceBehaviors> <behavior name="ServiceBehavior"> <serviceMetadata httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="True"/> <!-- 配置运行时吞吐量设置,这些设置可以优化服务性能--> <!-- maxConcurrentCalls:该值指定整个 ServiceHost 中正在处理的最多消息数--> <!-- maxConcurrentInstances:获取或设置一个值,该值指定服务中可以一次执行的最多 InstanceContext 对象数--> <!-- maxConcurrentSessions:获取或设置一个指定 ServiceHost 对象可一次接受的最多会话数的值--> <serviceThrottling maxConcurrentCalls="1000" maxConcurrentInstances="1000" maxConcurrentSessions="1000"/> </behavior> </serviceBehaviors> </behaviors> <bindings> <netTcpBinding> <!--openTimeout【类型 System.TimeSpan】:获取或设置在传输引发异常之前可用于打开连接的时间间隔,指定在超时前必须完成打开操作的时间,默认值为 1 分钟。--> <!--closeTimeout【类型 System.TimeSpan】:获取或设置在传输引发异常之前可用于关闭连接的时间间隔,指定在超时前必须完成关闭操作的时间,默认值为 1 分钟。--> <!--receiveTimeout【类型 System.TimeSpan】:获取或设置在传输引发异常之前可用于完成读取操作的时间间隔,指定在超时前必须完成读取操作的时间,默认值为 10 分钟。--> <!--sendTimeout【类型 System.TimeSpan】:获取或设置在传输引发异常之前可用于完成写入操作的时间间隔,指定在超时前必须完成写入操作的时间,默认值为 1 分钟。--> <!--【注意:如果对绑定或通道启用了事务流,执行操作所需的时间可能会比指定的超时时间长。在这些情况下,将会因为超时过期而导致操作失败,事务也将随之中止。】--> <!--maxBufferPoolSize:获取或设置内存中用于对传入消息进行缓冲的最大字节数。默认值为 65,536 字节。【注意:如果接收的数据超过了可进行缓冲处理的数据,则超出缓冲区大小的数据将保留在基础套接字中,直到缓冲区中具有可用于存储剩余数据的空间为止】--> <!--maxReceivedMessageSize:获取或设置在采用此绑定配置的通道上可接收的最大消息大小,绑定可处理的最大消息大小(以字节为单位)。默认值为 65,536 字节。【注意:对消息大小进行的此限制旨在降低遭受拒绝服务 (DoS) 攻击的可能性】--> <!--maxConnections:取或设置一个值,该值控制客户端上可存入池中以备后续重复使用的最大连接数,以及服务器上可挂起调度的最大连接数。默认值为 10。--> <!--listenBacklog:获取或设置可挂起的最大排队连接请求数,返回可挂起的最大排队连接请求数,默认值为 10。【注意:ListenBacklog 是套接字级别的属性,描述要排队的“挂起接受”请求数。应确保最大并发连接数不超过基础套接字队列】--> <binding name="ServiceBinding" openTimeout="00:03:00" closeTimeout="00:03:00" receiveTimeout="00:10:00" sendTimeout="00:03:00" maxBufferPoolSize="655350" maxReceivedMessageSize="1073741824" maxConnections="500" listenBacklog="1000"> <security mode="None"> <message clientCredentialType="None"/> </security> <!--获取或设置可由使用此绑定配置的终结点处理的 SOAP 消息的复杂性约束【下面几个值都是 int 值】--> <!--maxArrayLength:获取并设置允许的最大数组长度,默认值为 16384。【注意:此属性值应用于消息处理过程的每个步骤。包括可以扩展消息或消息部分大小的一些步骤。特别是,加密可能会大大增加消息的大小】--> <!--maxBytesPerRead:获取并设置允许每次读取返回的最大字节数,默认值为 4096。【注意:此配额与该传输级别在网络上接收的字节数密切相关,但其目的是控制每次读取时可以接收的数据量】--> <!--maxDepth:获取并设置最大嵌套节点深度,最大嵌套节点深度,默认值为 32。此配额设置 XML 的嵌套节点深度限制。【注意:不太重要,一般来说常用的 XML 深度不大可能达到32层】--> <!--maxNameTableCharCount:获取并设置表名称中允许的最大字符数,表名称中允许的最大字符数,默认值为 16384。【注意:暂时没用】--> <!--maxStringContentLength:获取并设置读取器返回的最大字符串长度,读取器返回的最大字符串长度,默认值为 8192。【注意:这个根据实际需要配置下,因为默认长度 8192 对于稍大的对象序列化后的长度很可能不够用】--> <readerQuotas maxArrayLength="1073741824" maxStringContentLength="1073741824"/> </binding> </netTcpBinding> </bindings> </system.serviceModel></configuration>
- netTcpBinding 客户端和服务端配置文件
- wsHttpBinding 客户端和服务端配置文件
- nagios服务端和客户端的正确配置文件
- WCF 安全机制 客户端和服务端配置文件
- 服务端和客户端
- XMPP 客户端和服务端
- RTSP 服务端和客户端
- webservice服务端和客户端
- 客户端和服务端
- XMPP 客户端和服务端
- flex客户端+vc服务端,实现配置文件修改
- netTcpBinding
- Genesis UDP 服务端 和 客户端
- socket通讯 客户端和服务端
- oracle服务端和客户端配置
- WCF客户端和服务端配置
- nodejs socket 服务端和客户端
- svn 服务端和客户端搭建
- 【转】VC Base64编解码
- MSG_NOSIGNAL
- mysql几个特殊有用的命令
- Iphone开发(六)IOS中的通知--操作表ActionSheet和警报AlertView
- perl基础知识06【转义与元字符与特殊字符】
- netTcpBinding 客户端和服务端配置文件
- PPP协议
- 高校数字化校园与网站群
- 被误解的 Node.js
- expdp impdp中 exclude/include 的使用 .
- epoll函数
- 优化你的java代码性能(代码方面)
- 黑客十条守则
- 【js学习笔记-007】--数字