发送大型XML从Silverlight来WCF [英] Sending large XML from Silverlight to WCF

查看:132
本文介绍了发送大型XML从Silverlight来WCF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要一个大的XML字符串发送到Silverlight的一个WCF SVC服务。

I want to send a big XML string to a WCF SVC service from Silverlight.

它看起来像什么下约50K的正确发送,但如果我尝试发送的东西超过这个限制,我的请求到达服务器(的BeginRequest被调用),但从来没有达到我的SVC。我得到了经典的NOTFOUND异常。

It looks like anything under about 50k is sent correctly but if I try to send something over that limit, my request reaches the server (BeginRequest is called) but never reaches my SVC. I get the classic "NotFound" exception.

在如何提高这一限制任何想法?

Any idea on how to raise that limit?

如果我不提出来?我有什么其他选择?

If I can't raise it? What are my other options?

下面是我的绑定配置

<bindings>
        <customBinding>
            <binding name="customBinding0" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647">
                <binaryMessageEncoding>
        <readerQuotas
            maxArrayLength="2147483647"
            maxBytesPerRead="2147483647"
            maxDepth="2147483647"
            maxNameTableCharCount="2147483647"
            maxStringContentLength="2147483647" />

      </binaryMessageEncoding>
                <httpTransport/>
            </binding>
            <binding name="customBindingSecure" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647">
                <binaryMessageEncoding>
        <readerQuotas
            maxArrayLength="2147483647"
            maxBytesPerRead="2147483647"
            maxDepth="2147483647"
            maxNameTableCharCount="2147483647"
            maxStringContentLength="2147483647" />
                </binaryMessageEncoding>
                <httpsTransport/>
            </binding>
        </customBinding>
    </bindings>

编辑:更多细节:如果我在Global.asax Endrequest打破,我的回应看错误的请求400

More details : If I break in the Global.asax Endrequest, I see in the Response "Bad Request 400"

编辑:再次详细信息:我激活了跟踪,我可以看到下面的错误:最大邮件大小配额传入消息(65536)已被超过。为了增加配额,使用MaxReceivedMessageSize属性相应绑定元素上。

More details again : I activated the Trace and I can see the following error : The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.

不过,我maxReceivedMessageProperty已设置为2147483647。

However, my maxReceivedMessageProperty is already set to 2147483647.

推荐答案

确定得到它的工作!

由于我使用的是customBinding,该maxReceivedMessageSize已经被这样的httpTransport元素上设置:

Since I am using a customBinding, the maxReceivedMessageSize has to be set on the httpTransport element like this :

<bindings>
        <customBinding>
            <binding name="customBinding0" >
                <binaryMessageEncoding>
        <readerQuotas
            maxArrayLength="2147483647"
            maxBytesPerRead="2147483647"
            maxDepth="2147483647"
            maxNameTableCharCount="2147483647"
            maxStringContentLength="2147483647" />

      </binaryMessageEncoding>
                <httpTransport maxReceivedMessageSize="4194304" />
            </binding>
            <binding name="customBindingSecure">
                <binaryMessageEncoding>
        <readerQuotas
            maxArrayLength="2147483647"
            maxBytesPerRead="2147483647"
            maxDepth="2147483647"
            maxNameTableCharCount="2147483647"
            maxStringContentLength="2147483647" />
                </binaryMessageEncoding>
                <httpsTransport  maxReceivedMessageSize="4194304" />
            </binding>
        </customBinding>
    </bindings>

感谢大家的帮助!

这篇关于发送大型XML从Silverlight来WCF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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