467,888 Members | 1,392 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,888 developers. It's quick & easy.

RE: WCF length quota (16384) has been exceeded while reading XML data.

Hi Gary,

As for the setting you mentioned, it is used to custimze the received data
size limitation of WCF binding(such as NetTcpBinding or HttpBinding).
After you have definite a customized Binding setting, you can apply it to
your WCF service via the "bindingConfiguration" attribute of each <endpoint>

here is a simple WCF service configuration in web.config which demonstrate
this:
====================================
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="RoleSecServiceBinding"
maxReceivedMessageSize="2147483647" >

<security mode="Message" >
<message clientCredentialType="UserName" />

</security>
</binding>
</wsHttpBinding>
</bindings>

<services>
<service name="RoleSecService">
<endpoint address="" binding="wsHttpBinding"

bindingConfiguration="RoleSecServiceBinding"
contract="IRoleSecService">
........................
</endpoint>
<endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>

</services>
</system.serviceModel>
==================================

You can get more info on customize WCF binding in the following articles:

#WCF Bindings In Depth
http://msdn.microsoft.com/en-us/magazine/cc163394.aspx

#WCF and Custom Bindings
http://blogs.msdn.com/kaevans/archiv...m-bindings.asp
x

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we

can improve the support we provide to you. Please feel free to let my
manager know what you think of

the level of service provided. You can send feedback directly to my manager
at: ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to

http://msdn.microsoft.com/en-us/subs...#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from

the community or a Microsoft Support Engineer within 2 business day is
acceptable. Please note that

each follow up response may take approximately 2 business days as the
support professional working

with you may need further investigation to reach the most efficient
resolution. The offering is not

appropriate for situations that require urgent, real-time or phone-based
interactions. Issues of this

nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft

Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subs.../aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
From: "GaryDean" <gd**********@newsgroup.nospam>
Subject: WCF length quota (16384) has been exceeded while reading XML data.
Date: Mon, 10 Nov 2008 15:34:18 -0700

This problem is all over the internet. However I have yet to see a single
straight answer.

My service works fine until I start passing a large byte[] and it gets this
error. My solution consists of a WCF Service Library hosted by IIS. My
WCF
Service Library has an app.config and the hosting website has a Web.config.
They are both pasted at the end of this post. I saw a solution, on A
poster
in a WCF forum that mentioned the following entries could be used:
Nov 11 '08 #1
  • viewed: 3915
Share:
2 Replies
Steven,
I haven't tested your answer but I had pursued this issue on the WCF forum
and got a working solution. It turned out to be more extensive. If you are
interested you can see the thread at
http://social.msdn.microsoft.com/For...2-1ff3e795bcfb
Regards,
Gary Blakely

""Steven Cheng"" <st*****@online.microsoft.comwrote in message
news:WQ**************@TK2MSFTNGHUB02.phx.gbl...
Hi Gary,

As for the setting you mentioned, it is used to custimze the received data
size limitation of WCF binding(such as NetTcpBinding or HttpBinding).
After you have definite a customized Binding setting, you can apply it to
your WCF service via the "bindingConfiguration" attribute of each
<endpoint>

here is a simple WCF service configuration in web.config which demonstrate
this:
====================================
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="RoleSecServiceBinding"
maxReceivedMessageSize="2147483647" >

<security mode="Message" >
<message clientCredentialType="UserName" />

</security>
</binding>
</wsHttpBinding>
</bindings>

<services>
<service name="RoleSecService">
<endpoint address="" binding="wsHttpBinding"

bindingConfiguration="RoleSecServiceBinding"
contract="IRoleSecService">
........................
</endpoint>
<endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>

</services>
</system.serviceModel>
==================================

You can get more info on customize WCF binding in the following articles:

#WCF Bindings In Depth
http://msdn.microsoft.com/en-us/magazine/cc163394.aspx

#WCF and Custom Bindings
http://blogs.msdn.com/kaevans/archiv...m-bindings.asp
x

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we

can improve the support we provide to you. Please feel free to let my
manager know what you think of

the level of service provided. You can send feedback directly to my
manager
at: ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to

http://msdn.microsoft.com/en-us/subs...#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from

the community or a Microsoft Support Engineer within 2 business day is
acceptable. Please note that

each follow up response may take approximately 2 business days as the
support professional working

with you may need further investigation to reach the most efficient
resolution. The offering is not

appropriate for situations that require urgent, real-time or phone-based
interactions. Issues of this

nature are best handled working with a dedicated Microsoft Support
Engineer
by contacting Microsoft

Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subs.../aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.


--------------------
From: "GaryDean" <gd**********@newsgroup.nospam>
Subject: WCF length quota (16384) has been exceeded while reading XML
data.
Date: Mon, 10 Nov 2008 15:34:18 -0700

This problem is all over the internet. However I have yet to see a single
straight answer.

My service works fine until I start passing a large byte[] and it gets
this
error. My solution consists of a WCF Service Library hosted by IIS. My
WCF
Service Library has an app.config and the hosting website has a
Web.config.
They are both pasted at the end of this post. I saw a solution, on A
poster
in a WCF forum that mentioned the following entries could be used:

Nov 12 '08 #2
Thanks for your reply Gary,

I've also read the forum thread you mentioned:

http://social.msdn.microsoft.com/For...538-eed4-48cd-
8252-1ff3e795bcfb

the solution mentioned there is the same as my last message. You can use
"bindingConfiguration" attribute to associate the customized binding
setting with your WCF service endpoint.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we

can improve the support we provide to you. Please feel free to let my
manager know what you think of

the level of service provided. You can send feedback directly to my manager
at: ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to

http://msdn.microsoft.com/en-us/subs...#notifications.

--------------------
From: "GaryDean" <gd**********@newsgroup.nospam>
References: <#$**************@TK2MSFTNGP04.phx.gbl>
<WQ**************@TK2MSFTNGHUB02.phx.gbl>
Subject: Re: WCF length quota (16384) has been exceeded while reading XML
data.
Date: Wed, 12 Nov 2008 08:23:34 -0700
Steven,
I haven't tested your answer but I had pursued this issue on the WCF forum
and got a working solution. It turned out to be more extensive. If you
are
interested you can see the thread at
http://social.msdn.microsoft.com/For...538-eed4-48cd-
8252-1ff3e795bcfb
Regards,
Gary Blakely

""Steven Cheng"" <st*****@online.microsoft.comwrote in message
news:WQ**************@TK2MSFTNGHUB02.phx.gbl...
Hi Gary,

As for the setting you mentioned, it is used to custimze the received data
size limitation of WCF binding(such as NetTcpBinding or HttpBinding).
After you have definite a customized Binding setting, you can apply it to
your WCF service via the "bindingConfiguration" attribute of each
<endpoint>

here is a simple WCF service configuration in web.config which demonstrate
this:
====================================
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="RoleSecServiceBinding"
maxReceivedMessageSize="2147483647" >

<security mode="Message" >
<message clientCredentialType="UserName" />

</security>
</binding>
</wsHttpBinding>
</bindings>

<services>
<service name="RoleSecService">
<endpoint address="" binding="wsHttpBinding"

bindingConfiguration="RoleSecServiceBinding"
contract="IRoleSecService">
........................
</endpoint>
<endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>

</services>
</system.serviceModel>
==================================
Nov 13 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Lonnie Princehouse | last post: by
1 post views Thread by Rajesh Kapur | last post: by
2 posts views Thread by Al Knowles | last post: by
3 posts views Thread by Hema S via DotNetMonster.com | last post: by
2 posts views Thread by Lloyd Dupont | last post: by
3 posts views Thread by =?Utf-8?B?UGV0ZXIgU2NobWl0eg==?= | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.