1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    2
    Vote Rating
    0
    rishabh.namdeo is on a distinguished road

      0  

    Default Unanswered: Error - "xml can't be the whole program" while making cross-domain call to fetch xml

    Unanswered: Error - "xml can't be the whole program" while making cross-domain call to fetch xml


    I am new to extjs and using it to make a cross-domain call. This call returns xml. This is my code

    <!DOCTYPE HTML>
    <html>
    <head>
    <title>EXTJS Getting Started: MyApp</title>
    <link rel="stylesheet" type="text/css" href="/extjs/resources/css/ext-all.css">
    <script type="text/javascript" src="/extjs/ext-all.js"></script>
    <script>
    Ext.define('QUERY_RESULTS', {
    extend: 'Ext.data.Model',
    fields: ['CONTENT']
    });
    var store = new Ext.data.Store({
    model: 'QUERY_RESULTS',
    proxy: {
    type: 'jsonp',
    url : 'http://sonewebsite.com/index?page=xmlfeed&channel=ALERTS&max=4&view=abc' ,
    reader : {
    type : 'xml',
    record: 'QUERY_RESULT'
    }
    }
    });
    store.load();
    alert(store);
    </script>
    </head>
    <body> </body>
    </html>
    It is giving me error as "xml can't be the whole program". I have checked through firebug, the response I am getting is correct, but the line " alert(store) " is not returning the desired response, instead its returning "[Object] [object]". How I can correct this issue ?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,347
    Answers
    3541
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    JSONP proxy will only work with JSON
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    May 2012
    Posts
    2
    Vote Rating
    0
    rishabh.namdeo is on a distinguished road

      0  

    Default


    I am also having the option for taking json as a feed in my code with the following changes-

    url : 'http://sonewebsite.com/index?page=jsonContent&channel=ALERTS&max=4&view=abc' ,
    type : 'json',

    But, still its giving me the same issue !

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,347
    Answers
    3541
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    There is no json proxy. To do cross origin calls you either have to use JSONP proxy (which you must use JSON not XML) or enable CORS and use the ajax proxy
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

Tags for this Thread