SOAP response getting truncated to 64 KB when soap fault occurs

Last post 09-17-2008 4:38 PM by gaestes. 5 replies.

Sort Posts:

  • SOAP response getting truncated to 64 KB when soap fault occurs

    12-03-2007, 12:00 AM
    • Contributor
      2,019 point Contributor
    • Jason Hill
    • Member since 04-23-2006, 3:39 AM
    • Sydney, Australia
    • Posts 482

    Hi,

    We have created a SOAP extension that logs all SOAP activity from our website to an external web service. This works fine except when a soap fault is generated and then for some reason the response is getting truncated to 64 KB and we then get malformed XML.

    We send and receive lots of other messages larger than 64 KB so I am not sure why the soap fault hits this limit. Is there a config setting that needs to be changes somewhere or some other way that we need to handle the message/stream during the soap fault?

    Thanks,

    Jason

  • Re: SOAP response getting truncated to 64 KB when soap fault occurs

    12-03-2007, 1:39 PM
    Answer
    • Participant
      1,540 point Participant
    • RogerRabbit
    • Member since 02-24-2007, 3:12 AM
    • Posts 247

    Set the DefaultMaximumErrorResponseLength property on the HttpWebRequest to a value large enough to hold the error.

    http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest.defaultmaximumerrorresponselength.aspx

  • Re: SOAP response getting truncated to 64 KB when soap fault occurs

    12-03-2007, 4:34 PM
    • Contributor
      2,019 point Contributor
    • Jason Hill
    • Member since 04-23-2006, 3:39 AM
    • Sydney, Australia
    • Posts 482

    Awesome...that did the trick. Thanks.

  • Re: SOAP response getting truncated to 64 KB when soap fault occurs

    09-17-2008, 10:16 AM
    • Member
      4 point Member
    • gaestes
    • Member since 09-17-2008, 9:54 AM
    • Posts 2

    I'm having the same problem.  Can you tell me where you set the DefaultMaximumResponseHeadersLength at?  I've tried setting it in the SoapExtension class and on form_load and the response is still being truncated.

     

    Thanks,

    Greg

  • Re: SOAP response getting truncated to 64 KB when soap fault occurs

    09-17-2008, 4:25 PM
    • Contributor
      2,019 point Contributor
    • Jason Hill
    • Member since 04-23-2006, 3:39 AM
    • Sydney, Australia
    • Posts 482

    In the web.config, after the system.web section, add the following:

      <system.net>
        <settings>
          <httpWebRequest maximumErrorResponseLength="-1"  />
        </settings>
      </system.net>

    -1 means unlimited but you can use any value in there for the number of bytes.

    Jason

  • Re: SOAP response getting truncated to 64 KB when soap fault occurs

    09-17-2008, 4:38 PM
    • Member
      4 point Member
    • gaestes
    • Member since 09-17-2008, 9:54 AM
    • Posts 2

     Thank you very much!!

Page 1 of 1 (6 items)