如何增加Silverlight Wcf限制 [英] How to increase Silverlight Wcf limit
本文介绍了如何增加Silverlight Wcf限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试提高我的Silverlight应用与其wcf服务之间的传输限制.
当我上传2kb的图像时,该应用程序可以正常工作,但是当我尝试上传30kb的图像时,它却无法正常工作.
我正忙于与此赛跑. (用Google搜索和全部搜索)
这是我的 ServiceReferences.ClientConfig 文件
I''m trying to increase my transfer limit between my silverlight app and its wcf service.
When i upload a 2kb image then the app works just fine but when I try to up a 30kb image then it doesn''t.
I''m busy running in circles with this one. (googled and all)
This is my ServiceReferences.ClientConfig file
<<pre lang="xml">configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService1" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:1320/Service1.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IService1"
contract="ServiceReference1.IService1"
name="LargeBuffer" />
</client>
</system.serviceModel>
</configuration
>
这是我的wcf服务 app.config 文件....
>
And this is my wcf service app.config file....
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="LargeBuffer" closeTimeout="00:01:00"
openTimeout="00:01:00"
receiveTimeout="00:10:00"
sendTimeout="00:01:00"
transferMode="Buffered"
maxReceivedMessageSize="73400320" >
<!--70MB-->
<readerQuotas maxArrayLength="73400320" />
</binding>
</basicHttpBinding>
</bindings>
<services />
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel
>
>
推荐答案
在您的服务行为中,您可以使用maxItemsInObjectGraph来增加接收配额.
In you service behavior, you can increase the quota to receive, by using the maxItemsInObjectGraph.
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<dataContractSerializer maxItemsInObjectGraph="6553600"/> <!--You can set this upto 2,147,483,647-->
</behavior>
@PumbaPumba.
尝试过它仍然不起作用.
情况有所改善.我手动将另一个映像添加到sql数据库中.因此,当它检索到信息时,它就可以正常工作,但是当我尝试从silverlight应用程序对wcf进行更新时,它会崩溃(但仍然可以处理2kb的图像).
@PumbaPumba.
Tried it an still doesn''t work.
Improvement to the situation. I manually added another Image into the sql db. So when it retrieves the information it work''s fine but when I try todo an update from the silverlight app to the wcf it crash''s (but still works with a image that is 2kb).
这篇关于如何增加Silverlight Wcf限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文