Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rich 22 posts 41 karma points
    Nov 21, 2011 @ 13:30
    Rich
    0

    Contour 'Failed to save form'

    Reading through the forums I've seen many people have this problem and I've tried the associated fixes for those people but I am still experiencing some problems.

    Most of my forms will save fine, but the larger ones (2 steps, 9 sections, 34 questions in total) are bringing up the dreaded 'failed to save form' speech bubble.

    The site is running 4.5.2 with contour 1.1.11.

    Looking at the reponses in firebug I can see that the reponse is a 500 and a message about the length of the parameter being too long

    {"Message":"Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
    Parameter name: input","StackTrace":" at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit)
    at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize[T](String input)
    at System.Web.Script.Services.RestHandler.GetRawParamsFromPostRequest(HttpContext context, JavaScriptSerializer serializer)
    at System.Web.Script.Services.RestHandler.GetRawParams(WebServiceMethodData methodData, HttpContext context)
    at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)","ExceptionType":"System.ArgumentException"}

     

    So seeing this we tried changing web.config to 

    <jsonSerialization maxJsonLength="2147483647"></jsonSerialization>

    (int.maxvalue) but we still receive the same problem. The form I am testing with has a value length of 136,843 from what I can see.

    Hoping someone has encountered this and has something helpful to say, or perhaps just point out something blindnigly obvious I am missing. There isn't some separate setting for length 

    Thanks in advance,
    Rich

     

  • Comment author was deleted

    Nov 24, 2011 @ 16:21

    Hi Rich, 

    Hmm looks like that should fix it, are you sure the web.config additions are correct( in correct section, correct casing...)

  • Christian Stenfors 80 posts 124 karma points
    Dec 01, 2011 @ 13:21
    Christian Stenfors
    0

    i am running a 4.7.1 site. I had the same problem with the form not saving. But changing the maxJsonLength value worked for me.

    I have a form with 6+ steps, an average of 2+ sections, and a average of 8+ questions pr. section, and still counting..

  • Rich 22 posts 41 karma points
    Dec 01, 2011 @ 14:06
    Rich
    0

    Oh, I thought I'd deleted this thread as I found the solution to be an exceptionally numptyish one about 5 minutes after posting....

    Person who made the changes to the live server had got a typo in the max length number... causing it to be greater than int.MaxValue which then results in it returning to the default value.

    Thanks for the replies anyway guys.... any way I can #h5is myself on this post?! ;)

    Rich

  • Niels 63 posts 119 karma points
    Mar 09, 2012 @ 17:00
    Niels
    4

    I had the same problem with a large form and changed the web.config with the following lines:

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

    I've test it locally and it worked out perfect, but when I test it on a online server it gives a 500-error. I've contacted my host and they didn't have a solution for this case. Any ideas about this?

     

  • Dennis Milandt 190 posts 517 karma points
    Oct 10, 2012 @ 14:37
    Dennis Milandt
    0

    Is there a solution or workaround to this?

    Dennis

Please Sign in or register to post replies

Write your reply to:

Draft