1. #1
    Sencha User
    Join Date
    Mar 2012
    Location
    Tunisia
    Posts
    74
    Vote Rating
    1
    zied jouini is on a distinguished road

      0  

    Default Unanswered: consume a web service with sencha touch 1

    Unanswered: consume a web service with sencha touch 1


    SALAM all.
    please i want to soncume a web service made with WCF, with sencha touch 1.
    here is a link to my web service 'http://localhost:8732/Service1/data/10' its return a JSON file
    {"Id":10,"Name":"Leo Messi"}


    Now i want to consume it with sencha touch 1, i try few code but without success.
    please please how can i consume it. its very important for me.
    thank you

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,633
    Answers
    3452
    Vote Rating
    817
    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


    Are you launching the app from localhost:8732? If so, you can use ajax with no problems. If not then you need to use jsonp or the scripttagproxy and have the JSON returned within the callback function specified in the request.
    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
    Mar 2012
    Location
    Tunisia
    Posts
    74
    Vote Rating
    1
    zied jouini is on a distinguished road

      0  

    Default


    thank you michelle.
    but the problem that i don't know how using jsonp or the scripttagproxy with sencha 1. in the kitchen of sencha they do it it with sencha2.
    I know Ibother youa bit but,can you correct methis code?
    Code:
    var App = new Ext.Application({
        name: 'webservice',
        useLoadMask: true,
        launch: function () {
    alert ("test json begin");
    
    
    
    
    
    
    				   
    	webservice.views.show = new Ext.Ajax.request({
                id: 'show',
                items: [{
                  xtype: 'panel',
                  id: 'JSONP',
                  url :'http://localhost:8732/Service1/data/10',
                  success : function() 
                    {
                         tpl= new Ext.XTemplate([
                            '<div >',
                                 '<tpl for=".">',
                                   '<div >',
                                     '<div class="Id">{Id}</div>',
                                     '<span class="Name">{Name}</span>',
                                   '</div>',
                                  '</tpl>',
                              '</div>'
                             ]);
                     }
                method: 'Get',
                  }]
    
    
    
    
            });
    
    
    
    
    webservice.views.Viewport = Ext.extend(Ext.Panel, {
        fullscreen: true,
        layout: 'card',
        cardSwitchAnimation: 'slide',
    items: [webservice.views.show]
    
    
    });
    
    
    
    
    
    
    }
    });
    thank you

Thread Participants: 1

Tags for this Thread