发送大型XML从Silverlight来WCFXML、Silverlight、WCF

由网友(重新 来过)分享简介:我要一个大的XML字符串发送到Silverlight的一个WCF SVC服务。I want to send a big XML string to a WCF SVC service from Silverlight.它看起来像什么下约50K的正确发送,但如果我尝试发送的东西超过这个限制,我的请求到达服务器(的Be...

我要一个大的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>

感谢大家的帮助!

阅读全文

相关推荐

最新文章