1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    26
    Vote Rating
    0
    gopikumar is on a distinguished road

      0  

    Default Unanswered: want to how to access web service using scripttag

    Unanswered: want to how to access web service using scripttag


    Hi all,

    I know how to access web service that returns xml using script tag. I have tried using JSON web service.
    Whether we can do in same manner, or what is the other approach.

    It will be much help ful if any one post how to access external webservice.

    My code as follows

    Ext.setup({
    onReady : function () {

    Ext.regModel('login', {
    fields: [
    {name: 'id'},
    {name:'name'}

    ]

    });


    myStore=new Ext.data.Store({
    model: 'login',
    proxy: {
    type: 'scripttag',
    url: 'http://www.2beinfluenced.com/sencha/app/myxml.xml',

    method: 'GET' ,
    //callbackParam: 'jsonp',
    reader: {
    type: 'xml',
    root: 'myXML',
    record:'user'
    }
    },
    autoLoad:true
    });


    new Ext.Panel({
    fullscreen: true,
    items:[
    {
    id: "post-list",
    xtype : 'list',
    style: "border-right: thick solid #000",
    store : myStore,
    itemTpl : '{id}'
    }
    ]





    })
    }
    });



    In my console I see the following errors

    Resource interpreted as Script but transferred with MIME type text/xml.
    myxml.xml:1Uncaught SyntaxError: Unexpected token <

  2. #2
    Sencha User
    Join Date
    Jun 2011
    Posts
    18
    Vote Rating
    0
    tr1x is on a distinguished road

      0  

    Default


    hallo gopikumar,

    i think it is not possible to access xml files through cross domains.
    you have to parse the xml file for example in a php file and access this through through the cross domain.

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    26
    Vote Rating
    0
    gopikumar is on a distinguished road

      0  

    Default


    Thanks Tr1X.
    So does it mean we cannot use web service that returns XML result in sencha touch.?

    As i am a beginner can u explain me how to access web-services using sencha touch.

  4. #4
    Sencha User
    Join Date
    Apr 2012
    Posts
    10
    Vote Rating
    0
    nidhigupta1812 is on a distinguished road

      0  

    Default


    Hi Gopi K,

    Since it has been long time since you have incurred the problem, hope you would have solved it up.
    Can you now guide us as to how to access the cross domain url into our store.

    Please do help us, we are into the problem since a week's time and it is required urgenntly.

    We have tried out using the script tag proxy, but no results.

    Thank you in hope of a definite help from your side.

    Thanks again

    Nidhi.

Thread Participants: 2