More in this section

Forums / Developing with Sitefinity / Webservices internal server error 500

Webservices internal server error 500

4 posts, 0 answered
  1. Pierre
    Pierre avatar
    433 posts
    16 Feb 2006
    08 Feb 2010
    Link to this post

    Implementing one Webservice i return one dataset to my Module template and digest as datasource for my grid client side. If i demand my webservice page directly i get my xlm dataset fine, but during module demad i get one internal error 500 from server and the response is like a binary in the content. Need some registering in web config or serialize?.

    Could you explain if sf securise webservices or implement some securities to prevent external consumption of my webservices or module services?

    Thanks Romi.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    08 Feb 2010
    Link to this post
    Hello Pierre,

    We use standard WebService and WebMethods. The WebMethods are embedded to the dlls, since the asmx file is exposed in Sitefinity/Admin/Services folder. The WebMethods use the API to retrieve data. Addintional web.config registration is not required.  You may find the following article useful - Chapter 12 – Building Secure Web Services

    Below is a sample code line that illustrates how you can check whether an user can delete a content object through web service

    manager.GetPermission(contentId, CrudRights.Delete).Demand();

    Ivan Dimitrov
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  3. Pierre
    Pierre avatar
    433 posts
    16 Feb 2006
    09 Feb 2010
    Link to this post
    Hi Team,

    Using you implementation for consoming contents is working, but use another webservice is more difficult because one internal problem is generated. I have tried many solutions to fixing this problem including registration of webservices protocols in web.config, i have tested many sort of services pasing datas like DataTables, Dataset as byte or serialised, i have tried serialisedDictionaries with same issue error 500. Only work very smal text like hello world from service.
    I have found this topic speaking about similar problems here but need build some httpmodule. i have tried using custom cache for my webservices, but all the time the custom cache is overrite by some internal cache feature resulting with same issue error 500.

    Tested : registration protocols, timeouts 
    Tested : Datatables, Datasets, as objects or json, text as webservices. simple text is working

    Using custom cache are overrite by some internal resulting troncated response.
    [WebMethod(CacheDuration=0,Description = "Returns Serialised Table with Planning.")]
            [System.Web.Script.Services.ScriptMethod(ResponseFormat = ResponseFormat.Json)]
            public SerializableDictionary<string, object> GetPlanningDataJson()
                //int timeout = this.Context.Server.ScriptTimeout;
                //this.Context.Server.ScriptTimeout = 4800;
                //this.Context.Server.ScriptTimeout = timeout; 
                //return PlanningData;
                TimeSpan cacheDuration = TimeSpan.Zero;//.FromSeconds(30)
                Context.Response.Cache.AppendCacheExtension("must-revalidate, proxy-revalidate");
                return JsonMethods.ToJson(PlanningData);

    Server  ASP.NET Development Server/
    Date    Tue, 09 Feb 2010 08:57:57 GMT
    X-AspNet-Version    2.0.50727
    jsonerror   true
    Cache-Control   private
    Content-Type    application/json; charset=utf-8
    Content-Length  382
    Connection  Close
    And content like :���� all cases

    I need some help.

  4. Pierre
    Pierre avatar
    433 posts
    16 Feb 2006
    11 Feb 2010
    Link to this post
    Hi Team,

    I lost. After many tests to perform the transfer from webservices using another item that simple strings i need to change the way.Only string seams to be correctly serialized. I have get your internal solution using Services and BindableData(data,num) but i'm not be able to obtain the result to pass to my grid client side using other datas like Tables or Dataset. I can´t obtain another response that error 500 and corrupt responses.

    regards, Romi
Register for webinar
4 posts, 0 answered