RadCompression and web service exceptions

4 posts, 0 answers
  1. Bent
    Bent avatar
    38 posts
    Member since:
    Sep 2008

    Posted 23 Apr 2009 Link to this post

    Hi there

    I've just spent 2 hours trying to figure out what was causing my problem.

    I have a web service which in some cases could throw an exception. When using the RadCompression module, the exception is not properly deserialized by the MS Ajax framework, resulting in a "'Message' is null or not an object" JavaScript error.

    How can I properly receive exceptions from my web services using the RadCompression module?
  2. Rosen
    Admin
    Rosen avatar
    3235 posts

    Posted 27 Apr 2009 Link to this post

    Hi Kenneth,

    I'm afraid that little can be done in this case as the compression filter is already applied to the response stream at the point where exception has been thrown. Thus you may consider to disable the compression for the pages which use the webservice in question. Or you may subclass the compression module and overriding the IsHttpCompressionEnabled to skip the json content type.

    Sincerely yours,
    Rosen
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Bent
    Bent avatar
    38 posts
    Member since:
    Sep 2008

    Posted 27 Apr 2009 Link to this post

    I understand that the compression is already applied, but why can't the Ajax framework decompress an exception? I'm not interested in completely deactivating compression of JSON content, I just wan't to be able to catch the exceptions on the client side.

    Is it a bug in MS Ajax?
  5. Rosen
    Admin
    Rosen avatar
    3235 posts

    Posted 30 Apr 2009 Link to this post

    Hi Kenneth,

    It seems that the error is caused by the fact that when the exception is thrown on the server the response's content encoding header is removed by the ajax framework and the browser is not aware that the content should be decompressed. However I'm happy to inform you that our developers has managed to find a possible workaround for this case, thus we will do our best to incorporate it in the next internal build of the module.

    Greetings,
    Rosen
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top