WCF Binding实例
2015-08-19 10:59
288 查看
BasicHttpBinding
WSHttpBinding
CustomBinding
<?xml version="1.0"?> <configuration> <system.web> <httpRuntime maxRequestLength="2097151" /> </system.web> <system.serviceModel> <behaviors> <endpointBehaviors> <behavior name="metadataBehavior"> <dataContractSerializer maxItemsInObjectGraph="2147483647"/> </behavior> </endpointBehaviors> </behaviors> <bindings> <basicHttpBinding> <binding name="basicHttpBinding_A" receiveTimeout="00:10:00" sendTimeout="00:10:00" openTimeout="00:10:00" closeTimeout="00:10:00" maxReceivedMessageSize="65536" maxBufferSize="65536" maxBufferPoolSize="524288" transferMode="Buffered" messageEncoding="Text" textEncoding="utf-8" bypassProxyOnLocal="false" useDefaultWebProxy="true" hostNameComparisonMode="StrongWildcard"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxNameTableCharCount="2147483647" maxBytesPerRead="2147483647" /> <security mode="None" /> <!--None、Transport、Message、TransportWithMessageCredential--> </binding> </basicHttpBinding> </bindings> <client> <endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_A" contract="契约地址" behaviorConfiguration="metadataBehavior" /> </client> </system.serviceModel> </configuration>
WSHttpBinding
<system.serviceModel> <behaviors> <endpointBehaviors> <behavior name="metadataBehavior"> <dataContractSerializer maxItemsInObjectGraph="2147483647"/> </behavior> </endpointBehaviors> </behaviors> <bindings> <wsHttpBinding> <binding name="WSHttpBinding_A" closeTimeout="00:55:00" openTimeout="00:55:00" receiveTimeout="00:55:00" sendTimeout="00:55:00" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" useDefaultWebProxy="false" allowCookies="false" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> <security mode="Transport"><!--None、Transport、Message、TransportWithMessageCredential--> <transport clientCredentialType="Windows" /><!--None、Basic、Digest、Ntlm、Windows、Certificate--> <message clientCredentialType="Windows"/><!--None、Windows、UserName、Certificate、IssuedToken--> </security> </binding> </wsHttpBinding> </bindings> <client> <endpoint address="https://localhost:444/soap12" behaviorConfiguration="metadataBehavior" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ISyncReply" contract="ServiceReference1.ISyncReply" name="WSHttpBinding_ISyncReply" /> </client> </system.serviceModel>
CustomBinding
<?xml version="1.0" encoding="utf-8"?> <configuration> <system.serviceModel> <bindings> <customBinding> <binding name="WSHttpBinding_IOneWay" > <textMessageEncoding messageVersion="Soap12"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> </textMessageEncoding> <httpsTransport maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" /> </binding> <binding name="WSHttpBinding_ISyncReply"> <textMessageEncoding messageVersion="Soap12"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> </textMessageEncoding> <httpsTransport maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" /> </binding> </customBinding> </bindings> <client> <endpoint address="https://localhost:444/soap12" binding="customBinding" bindingConfiguration="WSHttpBinding_IOneWay" contract="I2WebService.IOneWay" name="WSHttpBinding_IOneWay" /> <endpoint address="https://localhost:444/soap12" binding="customBinding" bindingConfiguration="WSHttpBinding_ISyncReply" contract="I2WebService.ISyncReply" name="WSHttpBinding_ISyncReply" /> </client> </system.serviceModel> </configuration>
相关文章推荐
- 隐藏系统布局的ProgressDialog中的button
- Spring 的ClassPathXmlApplicationContext()路径读取错误
- Java整型有序数组遍历一次输出其中重复的值
- Unable to execute dex: Multiple dex files define Landroid/support/v7/appcompat/R$anim;问题解决
- servlet设置缓存时间以及文件的下载
- text-align:justify实现文本两端对齐布局,兼容IE
- 指针函数笔记小结
- 各种移动GPU压缩纹理的使用方法
- WPF 自定义图片剪切器 - 头像剪切。你懂得
- Programming in scala学习笔记(一)First step in scala
- 基于IOS的sqlite数据库封装
- [易飞]事务与另一个进程被锁在锁资源上,并且被选做锁牺牲品
- Service和Thread的关系及如何启用Service,如何停用Service
- 转发重定向的用法
- hbase结合hive和sqoop实现数据指导mysql
- 程序员必须掌握的十种算法---堆排序算法
- SQL的连接语句
- 关于OpenGL ES中的纹理压缩
- Codevs1052 地鼠游戏
- ZOJ 3471 Most Powerful(状压DP)