Results 1 to 4 of 4

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

  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    2
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,326
    Answers
    3884
    Vote Rating
    1297
      0  

    Default

    JSONP proxy will only work with JSON
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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
      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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,326
    Answers
    3884
    Vote Rating
    1297
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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.

Tags for this Thread

Posting Permissions

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