WFC problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marco Pais

    WFC problem

    Hi there.

    I'm having a problem with a Web Service that I've created. This WS has
    several simple methods, that are working fine... no problem with code.

    However, when retieving a bigger number of rows, I get this error:

    "The maximum message size quota for incoming messages (65536) has been
    exceeded. To increase the quota, use the MaxReceivedMess ageSize property on
    the appropriate binding element. "

    I then searched google for some help/explanation and I found this site,
    amoung others:



    Initialy, my web config on the server is like this:
    ------------------------
    <?xml version="1.0" encoding="utf-8"?>
    <configuratio n>
    <system.web>
    <compilation defaultLanguage ="c#" />
    </system.web>

    </configuration>
    ------------------------

    If I follow the instructions on that post, my WS returns error.

    How can I configurate this??

    Thanks in advance,

    Marco


  • Marc Gravell

    #2
    Re: WFC problem

    Are you sure that is your web.config? WCF typically has a LOT more
    config than that (in system.ServiceM odel), for either the client or the
    server.

    If your app is setting up the configuration through code (which is
    entirely possible with WCF) then you need to find the bit of code that
    configures the binding. Note that these quotas don't just apply to the
    server; setting it at the server is useful for uploading larger arrays
    etc, but the quotas may need to be independently set at the client if
    the problem is the server *returning* too much data.

    Marc

    Comment

    • Marc Gravell

      #3
      Re: WFC problem

      I've re-read your post, and indeed it looks like a client issue; try
      changing app.config at the client instead. For example, for basic-http
      you might have:

      <bindings>
      <basicHttpBindi ng>
      <binding ... maxReceivedMess ageSize="655360 0" maxBufferSize=" 6553600">
      <readerQuotas maxArrayLength= "250000" />
      </binding>
      </basicHttpBindin g>
      </bindings>

      Additionally, you might want to think about using streamed MTOM if you
      are returning binary; you can add transferMode="S treamed" and
      messageEncoding ="Mtom" to "binding" for basic-http (but not for all
      bindings) - but you need to do this at both the client and the server or
      it will break [which is why I didn't add them above].
      The quotas etc should be fine set at one end only (since it is expected
      that client and server should have different quotas).

      Marc

      Comment

      • Marco Pais

        #4
        Re: WFC problem

        Thanks for the reply.

        So, you say that I can configure client independently, without the need to
        configure the server? The problem is when downloading data, never with
        upload. And how can I do this? Because I used this client config:

        <?xml version="1.0" encoding="utf-8" ?>

        <configuratio n>

        <system.service Model>

        <bindings>

        <basicHttpBindi ng>

        <binding name="ServiceSo ap" closeTimeout="0 0:01:00" openTimeout="00 :01:00"

        receiveTimeout= "00:10:00" sendTimeout="00 :01:00" allowCookies="f alse"

        bypassProxyOnLo cal="false" hostNameCompari sonMode="Strong Wildcard"

        maxBufferSize=" 65536" maxBufferPoolSi ze="524288"
        maxReceivedMess ageSize="65536"

        messageEncoding ="Text" textEncoding="u tf-8" transferMode="B uffered"

        useDefaultWebPr oxy="true">

        <readerQuotas maxDepth="32" maxStringConten tLength="8192"
        maxArrayLength= "16384"

        maxBytesPerRead ="4096" maxNameTableCha rCount="16384" />

        <security mode="None">

        <transport clientCredentia lType="None" proxyCredential Type="None"

        realm="" />

        <message clientCredentia lType="UserName " algorithmSuite= "Default" />

        </security>

        </binding>

        </basicHttpBindin g>

        </bindings>

        <client>

        <endpoint address="http://servidor:8080/ws/Service.asmx"
        binding="basicH ttpBinding"

        bindingConfigur ation="BasicHtt pBinding_IOrder Service"
        contract="IOrde rService"

        behaviorConfigu ration="LargeQu otaBehavior"

        name="ServiceSo ap" />

        </client>

        </system.serviceM odel>

        </configuration>


        and I get this error:

        "There is no endpoint behavior named 'LargeQuotaBeha vior'. "

        Thanks in advance.



        "Marc Gravell" <marc.gravell@g mail.comescreve u na mensagem
        news:uNCpzRinIH A.5944@TK2MSFTN GP03.phx.gbl...
        Are you sure that is your web.config? WCF typically has a LOT more config
        than that (in system.ServiceM odel), for either the client or the server.
        >
        If your app is setting up the configuration through code (which is
        entirely possible with WCF) then you need to find the bit of code that
        configures the binding. Note that these quotas don't just apply to the
        server; setting it at the server is useful for uploading larger arrays
        etc, but the quotas may need to be independently set at the client if the
        problem is the server *returning* too much data.
        >
        Marc

        Comment

        • Marc Gravell

          #5
          Re: WFC problem

          behaviorConfigu ration relates to the "behaviors" element, and can be
          used to create your own stack with custom listeners etc. I think you can
          remove this attribute; bindingConfigur ation relates to the binding -
          you've named this "ServiceSoa p", so this is what the
          bindingConfigur ation attribute should say.

          "BasicHttpBindi ng_IOrderServic e" looks like it should be the name (which
          can often actually be left blank).

          So try:

          <client>
          <endpoint address="http://servidor:8080/ws/Service.asmx"
          binding="basicH ttpBinding"
          bindingConfigur ation="ServiceS oap"
          contract="IOrde rService"
          name="BasicHttp Binding_IOrderS ervice" />
          </client>

          If you get errors about not finding the configuration, try removing the
          name attribute. Also - I'm a little worried about it finding the
          contract - I usually use the full-qualified name
          (Foo.Bar.IOrder Service), but if it works...

          Marc

          Comment

          • Marc Gravell

            #6
            Re: WFC problem

            So, you say that I can configure client independently,
            without the need to configure the server?
            This is pretty-much limited to quotas, maximum sizes, and behaviors
            (i.e. a behavour can be used to inject error-handling or performance
            metrics - these aren't part of the channel itself). Pretty-much
            everything else must match. It will tell you soon enough if there is a
            problem...

            Marc

            Comment

            Working...