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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steven Cheng

    #1

    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 "bindingConfigu ration" attribute of each <endpoint>

    here is a simple WCF service configuration in web.config which demonstrate
    this:


    =============== =============== ======
    <system.service Model>
    <bindings>
    <wsHttpBindin g>
    <binding name="RoleSecSe rviceBinding"
    maxReceivedMess ageSize="214748 3647" >

    <security mode="Message" >
    <message clientCredentia lType="UserName " />

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

    <services>
    <service name="RoleSecSe rvice">
    <endpoint address="" binding="wsHttp Binding"



    bindingConfigur ation="RoleSecS erviceBinding"


    contract="IRole SecService">
    ............... .........
    </endpoint>
    <endpoint address="mex" binding="mexHtt pBinding"
    contract="IMeta dataExchange" />
    </service>

    </services>
    </system.serviceM odel>
    =============== =============== ====

    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: msdnmg@microsof t.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" <gdeanblakely@n ewsgroup.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:
  • GaryDean

    #2
    Re: WCF length quota (16384) has been exceeded while reading XML data.

    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
    The home for technical questions and answers at Microsoft. Get started asking, answering, and browsing questions about products like .Net, Azure, or Teams.

    Regards,
    Gary Blakely

    ""Steven Cheng"" <stcheng@online .microsoft.comw rote in message
    news:WQwl6b8QJH A.1672@TK2MSFTN GHUB02.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 "bindingConfigu ration" attribute of each
    <endpoint>
    >
    here is a simple WCF service configuration in web.config which demonstrate
    this:
    >
    >
    =============== =============== ======
    <system.service Model>
    <bindings>
    <wsHttpBindin g>
    <binding name="RoleSecSe rviceBinding"
    maxReceivedMess ageSize="214748 3647" >
    >
    <security mode="Message" >
    <message clientCredentia lType="UserName " />
    >
    </security>
    </binding>
    </wsHttpBinding>
    </bindings>
    >
    <services>
    <service name="RoleSecSe rvice">
    <endpoint address="" binding="wsHttp Binding"
    >
    >
    >
    bindingConfigur ation="RoleSecS erviceBinding"
    >
    >
    contract="IRole SecService">
    ............... .........
    </endpoint>
    <endpoint address="mex" binding="mexHtt pBinding"
    contract="IMeta dataExchange" />
    </service>
    >
    </services>
    </system.serviceM odel>
    =============== =============== ====
    >
    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: msdnmg@microsof t.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" <gdeanblakely@n ewsgroup.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:

    Comment

    • Steven Cheng

      #3
      Re: WCF length quota (16384) has been exceeded while reading XML data.

      Thanks for your reply Gary,

      I've also read the forum thread you mentioned:

      The home for technical questions and answers at Microsoft. Get started asking, answering, and browsing questions about products like .Net, Azure, or Teams.

      8252-1ff3e795bcfb

      the solution mentioned there is the same as my last message. You can use
      "bindingConfigu ration" 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: msdnmg@microsof t.com.

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

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



      --------------------
      From: "GaryDean" <gdeanblakely@n ewsgroup.nospam >
      References: <#$qa2R4QJHA.19 60@TK2MSFTNGP04 .phx.gbl>
      <WQwl6b8QJHA.16 72@TK2MSFTNGHUB 02.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
      The home for technical questions and answers at Microsoft. Get started asking, answering, and browsing questions about products like .Net, Azure, or Teams.

      8252-1ff3e795bcfb
      Regards,
      Gary Blakely

      ""Steven Cheng"" <stcheng@online .microsoft.comw rote in message
      news:WQwl6b8QJH A.1672@TK2MSFTN GHUB02.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 "bindingConfigu ration" attribute of each
      <endpoint>
      >
      here is a simple WCF service configuration in web.config which demonstrate
      this:
      >
      >
      =============== =============== ======
      <system.service Model>
      <bindings>
      <wsHttpBindin g>
      <binding name="RoleSecSe rviceBinding"
      maxReceivedMess ageSize="214748 3647" >
      >
      <security mode="Message" >
      <message clientCredentia lType="UserName " />
      >
      </security>
      </binding>
      </wsHttpBinding>
      </bindings>
      >
      <services>
      <service name="RoleSecSe rvice">
      <endpoint address="" binding="wsHttp Binding"
      >
      >
      >
      bindingConfigur ation="RoleSecS erviceBinding"
      >
      >
      contract="IRole SecService">
      ............... .........
      </endpoint>
      <endpoint address="mex" binding="mexHtt pBinding"
      contract="IMeta dataExchange" />
      </service>
      >
      </services>
      </system.serviceM odel>
      =============== =============== ====
      >

      Comment

      Working...