Coder Social home page Coder Social logo

Comments (4)

CptRobby avatar CptRobby commented on August 21, 2024

According to the MSDN Docs, the default value for MaxJsonLength is "2097152 characters, which is equivalent to 4 MB of Unicode string data."

You say that it's logging SOAP communications. What type of data are you transferring via SOAP? I mean are you sending messages that you would expect to exceed 3 or 4 MB?

Judging by where you say that the error is happening (when viewing an error, not logging the error), I'm thinking that this is the call to Error.ToDetailedJson(), which is written out to the webpage in a script tag, which the browser then interprets as a JavaScript object. But if this were to output more than 4 MB of JSON then you might end up having issues with your browser trying to deal with something that large (not to mention a long load time if it's having to be served over an internet connection).

Don't get me wrong, I'm not saying that you're doing anything wrong, just trying to help and figure out what you're trying to do. 😉

from stackexchange.exceptional.

stijnherreman avatar stijnherreman commented on August 21, 2024

@CptRobby some messages that we receive go up to 15 MB because they can contain PDFs in bas64 form.

We're doing the following: every request, a number of SOAP calls are done. We keep these in a per-request log store. If the request is completed succesfully, the data is discarded. If not, we throw and log an exception that includes all SOAP calls for that request.

from stackexchange.exceptional.

NickCraver avatar NickCraver commented on August 21, 2024

I would personally not log that with the exception since that's a ton of data to rack up :) But if you must, that limit is adjustable. In your web.config or app.config here's the setting to up the that 2MB default limit:

<configuration> 
   <system.web.extensions>
       <scripting>
           <webServices>
               <jsonSerialization maxJsonLength="20000000"/>
           </webServices>
       </scripting>
   </system.web.extensions>
</configuration> 

from stackexchange.exceptional.

stijnherreman avatar stijnherreman commented on August 21, 2024

@NickCraver I agree it's not an ideal solution, they should be logged separately and the exception should just include an identifier. But time and budget were not on my side :) I'll try the config change, thanks.

from stackexchange.exceptional.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.