Web Service .asmx returns null

4 posts, 1 answers
  1. Timothy
    Timothy avatar
    41 posts
    Member since:
    Aug 2011

    Posted 03 Jan 2012 Link to this post

    Running VS2010 (SP1) using the latest Telerix Q3 2011 controls, ASP.NET version 4, AjaxControltoolkit version 4 on a Windows 2008 R2 installation.
    I am using a web service:-
       [ScriptService]
       [WebService(Namespace = "http://tempuri.org/")]
       [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
       public class PS_AdminWebInterface : System.Web.Services.WebService
       {
          [WebMethod(EnableSession = true)]
          public string[] GetSessionString(string sessionKey)
          {
             string[] results = new string[2];
             results[0] = sessionKey;
             try
             {
                if (Session["ClientID"].ToString() == "0")            //Logged in users only
                {
                   results[1] = "";
                   Session["ErrorOccurred"] = true;
                }
                else if (Session[sessionKey] == null)       //Does key exist
                {
                   results[1] = "";
                   Session["ErrorOccurred"] = true;
                }
                else
                   results[1] = Session[sessionKey].ToString();
             }
             catch
             {
                results[1] = "";
             }
             return results;
          }
    }

    I have debugged the web service call and it is definitely being called and no exception is raised - however the javascript call :-
    PlumSoftware.PS_AdminWebInterface.GetSessionString(ps_interface_sessionKey, GetSessionString, OnTimeOut, OnServiceError);

    fails in the following function:-
    function GetSessionString(result)
    {
       if (result[1] != "0")
       {          //Data changed
          ps_interface_keepalive = 0; //Reset keepalive
          __doPostBack(ps_interface_postbackcontrol.value, result[1]);
       }
    }

    the result returned is always null

    I have spent a few hours looking through your forums but have found no clues as to why this would be happening.
  2. Answer
    Veli
    Admin
    Veli avatar
    2002 posts

    Posted 04 Jan 2012 Link to this post

    Hi Timothy,

    The code you provided seems OK and I cannot spot what might be the issue here. If you can open a support ticket and submit a sample project demonstrating this issue, our support staff will be happy to look into this.

    Veli
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. Timothy
    Timothy avatar
    41 posts
    Member since:
    Aug 2011

    Posted 04 Jan 2012 Link to this post

    Hi - fired up Ie9 developer tools to have a peek a what was being sent back from the web service. In the production environment the response body looks like :-
    {"d":["ChargeDataChanged","0"]}
    in the development environment where I am testing the Telerik framework it comes back as :-
    ‹      ì½`I–%&/mÊ{JõJ×àt¡€`$ؐ@ìÁˆÍæ’ìiG#)«*ÊeVe]f@Ì흼÷Þ{ï½÷Þ{ï½÷º;N'÷ßÿ?\fdlöÎJÚÉž!€ªÈ?~|?"~—?ö7ø5ðü:¿Æ÷÷ÿúÀïtögüî¿ðîâŸùÅàw~ÅwþÍÿ¨ý‹ƒ?èø-·ëOú=³ÿîþ£þùÿâOùï~çâó¿ó×~ëþgòŸÌ¿þÛüžÿÜÿçÿ}¿ò?øÅÿãß/ÿü=‡þ‹åøÿ¿ïùì×,ÿ×á;ÿÎ?ýü®Ð_óOý.¿Ç/ý™ßå÷øè—þÏŸÿ­â/ø%ÿã_ú§þ-ÿÔŸùßÿ¹“?ù¼þ¥ÿÁößþ—þ‰Gÿûÿu÷Wý¿Ö¯ñküßÿ÷PüÓßù×ø5~ÿ'  ÿÿ~ÊE¿š  

    It seems like the response body is coming back compressed with gzip, I have turned off Static and Dynamic compression at both the server level and the site level but the response still comes back compressed - what am I missing??
  4. Timothy
    Timothy avatar
    41 posts
    Member since:
    Aug 2011

    Posted 04 Jan 2012 Link to this post

    Hi - after further investigation I found an old module that I used to compress json requests and responses - once this was removed everything worked fine.
Back to Top