Results 1 to 4 of 4

Thread: server return 200 OK but no content

  1. #1

    Default server return 200 OK but no content

    I have a Store:
    Code:
    a = new Ext.data.Store({
                        model: 'Location',
                        proxy: {
                            headers: {
                                'Accept-Type': 'application/json',
                                'Cache-Control': 'no-cache'
                            },
                            type: 'ajax',
                            timeout: 600,
                            actionMethods: 'POST',
                            url: 'bwpos.asmx/LocationList',
                            reader: {type:'json'}
                        },
                        autoLoad: true
                    })
    Onserver:
    Code:
    [WebMethod]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        public string LocationList()
        {
            // GEt location
            
            // end get location
            //return JavaScriptConvert.SerializeObject(locationList);
            //return locationList;
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            Context.Response.Write(JavaScriptConvert.SerializeObject(VisualData.locationList));
            Context.Response.End();
    
            return "a";
            
        }
    when i load data to store from server, 8/10 request success, but 2 others error:
    failed:

    success:

    Please help me!

  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    Are returning "a" or an actual serialized json object?

  3. #3
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,392

    Default

    Jay is right... first make sure your returned JSON is valid... http://www.jsonlint.com for the validation.

    If you still can't figure it out, listen for the exception event on the Store:

    Code:
    new Ext.data.Store({
        ...
        listeners: {
            exception: function(proxy, type, action, options, response, arg) {
                //console some of these and it can tell you what's going on
            }
        }
    });
    Lot of times I have my root set wrong or something and this tells me where I need to look.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  4. #4

    Default solved

    Thx jgarcia and mitch,
    After fix my webservices, everything is ok
    Code:
        [WebMethod]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        public ArrayList LocationList()
        {
            return VisualData.locationList;       
        }

Similar Threads

  1. responseText return all code of server side
    By vanderbill in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 25 Jan 2009, 1:29 PM
  2. How to return data from the server that is not XML or JSON
    By rtikku in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 28 Nov 2008, 4:06 AM
  3. A form that posts to a a server and then grid created on return
    By quarta77 in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 27 Jul 2008, 10:48 AM
  4. Server-Side validator and return error message into FormPanel
    By Romantik in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 9 Jun 2008, 2:12 PM
  5. What should the server return after a form submit?
    By twist3r in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 29 Feb 2008, 8:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •