如何使用wsHttpBinding将大数据从一个wcf服务发送到另一个wcf服务 [英] How to send large data from one wcf service to another using wsHttpBinding

查看:78
本文介绍了如何使用wsHttpBinding将大数据从一个wcf服务发送到另一个wcf服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在尝试从一个wcf服务向另一个服务发送大量数据(byte [])。

我以为我的app.config是正确的但是我得到了MaxReceivedSize异常。

这是我的两个服务的app.config(唯一不同的是地址和类似的东西)。



/ ****



配置>



system.servicemodel>

绑定>

wshttpbinding>

binding name =MessageSizeBasicmaxbufferpoolsize =2147483647maxreceivedmessagesize = 2147483647sendtimeout =00:05:00receivetimeout =00:05:00>

readerquotas maxdepth =32maxstringcontentlength =2147483647>

maxArrayLength =104857600maxBytesPerRead =4096maxNameTableCharCount =16384

/ readerquotas>

/ binding>

/ wshttpbinding>



/ bin dings>

服务>

服务名称=Serv1Namebehaviorconfiguration =Behavior1>

端点>

address =adress1

binding =wsHttpBinding

contract =contract1

bindingConfiguration =MessageSizeBasic

/>

主机>

< baseAddresses>

< add baseaddress =adress1>

< / baseAddresses>

/ host>

/ endpoint>

/ services>

行为>

servicebehaviors>

行为名称=行为1>

datacontractserializer maxitemsinobjectgraph =2147483647/>

servicemetadata httpgetenabled =true/>

servicedebug includeexceptiondetailinfaults =True/>

/ b行为>

/ servicebehaviors>

/行为>



/system.servicemodel>

system.web>

httpruntime maxrequestlength =68000000/>

/system.web>

/ configuration>



/ ****



你能说出我做错了什么吗?

Hi everyone,

I'm trying to send a large amount of data (byte[]) from one wcf service to another.
I thought my app.config is correct but i'm getting the MaxReceivedSize exception.
Here is the app.config of my both services (only difference is the adress and stuff like that).

/****

configuration>

system.servicemodel>
bindings>
wshttpbinding>
binding name="MessageSizeBasic" maxbufferpoolsize="2147483647" maxreceivedmessagesize="2147483647" sendtimeout="00:05:00" receivetimeout="00:05:00">
readerquotas maxdepth="32" maxstringcontentlength="2147483647">
maxArrayLength="104857600" maxBytesPerRead="4096" maxNameTableCharCount="16384"
/readerquotas>
/binding>
/wshttpbinding>

/bindings>
services>
service name="Serv1Name" behaviorconfiguration="Behavior1">
endpoint>
address="adress1"
binding="wsHttpBinding"
contract="contract1"
bindingConfiguration="MessageSizeBasic"
/>
host>
<baseAddresses>
<add baseaddress="adress1">
</baseAddresses>
/host>
/endpoint>
/services>
behaviors>
servicebehaviors>
behavior name="Behavior1">
datacontractserializer maxitemsinobjectgraph="2147483647" />
servicemetadata httpgetenabled="true" />
servicedebug includeexceptiondetailinfaults="True" />
/behavior>
/servicebehaviors>
/behaviors>

/system.servicemodel>
system.web>
httpruntime maxrequestlength="68000000" />
/system.web>
/configuration>

/****

Can you please tell what have i done wrong?

推荐答案

<binding bypassproxyonlocal="true" usedefaultwebproxy="false" hostnamecomparisonmode="WeakWildcard" sendtimeout="10:15:00" opentimeout="10:15:00" receivetimeout="10:15:00" maxbuffersize="2147483647" transfermode="StreamedRequest" maxbufferpoolsize="2147483647" maxreceivedmessagesize="2147483647">
         <readerquotas maxdepth="2147483647" maxstringcontentlength="2147483647" maxarraylength="2147483647" maxbytesperread="2147483647" maxnametablecharcount="2147483647" />
         <security mode="None" />
       </binding>







use this inside

<wshttpbinding></wshttpbinding>




通过分块大数据,你可以实现它,即使它不加载连接时服务器。



http ://msdn.microsoft.com/en-us/library/aa717050.aspx [ ^ ]



希望这对你有所帮助。
Hi,
By chunking the large data you can achieve it , even it does not load server when the connections goes up.

http://msdn.microsoft.com/en-us/library/aa717050.aspx[^]

hope this will help you.


谢谢你非常想试试这个。
Thank you very much i will try this out .


这篇关于如何使用wsHttpBinding将大数据从一个wcf服务发送到另一个wcf服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆