locked
Create an instance of proxy class for every ListItem RRS feed

  • Question

  • User136806914 posted

    I created a client application by consuming API's,  loop through a small set of List  & call the API . I get 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"

    even for a small set of List items(i guess this may be due to huge XML  string i get as a response). Instead of changing the config file to increase maxReceivedMessagesize similar to below mentioned i was thinking of creating an instance of proxy class everytime i loop through the List. How much overhead is creating a instance of proxy class??

         <basicHttpBinding>
            <binding name="APIWebServiceSoap" allowCookies="true"
                     maxReceivedMessageSize="2147483647"
                     maxBufferSize="2147483647"
                     maxBufferPoolSize="2147483647">
              <readerQuotas maxDepth="32"
                   maxArrayLength="2147483647"
                   maxStringContentLength="2147483647"/>
            </binding>
          </basicHttpBinding>

    Friday, October 27, 2017 11:19 PM

Answers

  • User475983607 posted

    The problem i am seeing is, if there is a failure in API call(response has an error) it retains the response from previous call(in the loop) which gives me incorrect data. I can't seem to figure out why it's retaining the response from previous object during the loop

    Any tips or suggestions??

    You're probably reusing the same variables in the loop.  It's hard to determine when there is no source code.

    Either clear the variables at the start of the loop, the end of the loop, or within an exception handler.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 14, 2017 10:23 PM

All replies

  • User-271186128 posted

    Hi PraveenAmar,

    In application, we call various services here and there.

    It will be great if we call multiple services in parallel to improve the response time of the application.

    As we know, asynchronous processing improves performances by running non- blocking thread in background.

    One best scenario to implement asynchronous programming is service call.

    How to: Make Multiple Web Requests in Parallel by Using Async and Await (C# and Visual Basic)
    https://msdn.microsoft.com/en-us/library/hh696703(v=vs.140).aspx

    Tips And Tricks To Improve WEB API Performance
    http://www.c-sharpcorner.com/article/important-steps-to-increasing-web-api-performance/

    Best regards,
    Dillion

    Monday, October 30, 2017 6:48 AM
  • User136806914 posted

    The problem i am seeing is, if there is a failure in API call(response has an error) it retains the response from previous call(in the loop) which gives me incorrect data. I can't seem to figure out why it's retaining the response from previous object during the loop

    Any tips or suggestions??

    Tuesday, November 14, 2017 10:06 PM
  • User475983607 posted

    The problem i am seeing is, if there is a failure in API call(response has an error) it retains the response from previous call(in the loop) which gives me incorrect data. I can't seem to figure out why it's retaining the response from previous object during the loop

    Any tips or suggestions??

    You're probably reusing the same variables in the loop.  It's hard to determine when there is no source code.

    Either clear the variables at the start of the loop, the end of the loop, or within an exception handler.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 14, 2017 10:23 PM