1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    13
    Vote Rating
    0
    vipsshan is on a distinguished road

      0  

    Default How to implement web services(WCF Rest service) in sencha touch 2

    How to implement web services(WCF Rest service) in sencha touch 2


    Hi,
    How to implement WCF Rest services in sencha Touch 2. Could you send me the example.

    Thanks & Regards
    Vipin

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,710
    Vote Rating
    436
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Use a store with a proxy or an ajax request
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    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 almost in print!

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

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    13
    Vote Rating
    0
    vipsshan is on a distinguished road

      0  

    Default How to implement web services(WCF Rest service) in sencha touch 2

    How to implement web services(WCF Rest service) in sencha touch 2


    Hi,
    Actually on Sencha site it is written that if you are calling a webservice wich is out side the domain you should use Jsonp, but when I am using it as follows:-
    Ext.define("App.store.Contacts", {
    extend:"Ext.data.Store",
    // requires: [
    // "Ext.data.proxy.JsonP"
    // ],
    config:{
    model:"App.model.Contacts",
    // autoLoad:true,
    sorters:"first_name",
    grouper: function(record){
    return record.get('first_name')[0];
    },
    proxy:{
    type:"jsonp",
    //url: "contacts.json",
    url:"http://10.4.3.199/FineDocsMobileServices/Service1.svc/TestSenchaAdd?Dn=yes",
    callbackKey: 'callback',
    headers: {
    'content-type': 'application/json'
    },
    reader:{
    type:"json",
    rootProperty:"contacts"
    }

    },
    autoLoad:true

    }
    });


    The above used web service "http://10.4.3.199/FineDocsMobileServices/Service1.svc/TestSenchaAdd?Dn=yes" is giving following result in brwoser

    (
    {
    "contacts": [
    {
    "first_name": "FirstName1",
    "last_name": "LastName1"
    },
    {
    "first_name": "FirstName2",
    "last_name": "LastName2"
    }
    ]
    }
    );


    But getting the following error in Sencha touch 2 while executing the above code.

    Resource interpreted as Script but transferred with MIME type application/octet-stream: "
    http://10.4.3.199/FineDocsMobileServices/Service1.svc/TestSenchaAdd?Dn=yes&callback=?&_dc=1342784796368&page=1&start=0&limit=25&callback=Ext.data.JsonP.callback1".

    Thanks & Regards
    Vipin

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

      0  

    Default


    Hi,

    How to resolve this type error?. Please help me

    Resource interpreted as Script but transferred with MIME type application/octet-stream: "http://10.4.3.199/FineDocsMobileServ...sonP.callback1".


    Thanks & Regards
    Vipin


    Quote Originally Posted by vipsshan;

    857788
    Hi,
    Actually on Sencha site it is written that if you are calling a webservice wich is out side the domain you should use Jsonp, but when I am using it as follows:-
    Ext.define("App.store.Contacts", {
    extend:"Ext.data.Store",
    // requires: [
    // "Ext.data.proxy.JsonP"
    // ],
    config:{
    model:"App.model.Contacts",
    // autoLoad:true,
    sorters:"first_name",
    grouper: function(record){
    return record.get('first_name')[0];
    },
    proxy:{
    type:"jsonp",
    //url: "contacts.json",
    url:"http://10.4.3.199/FineDocsMobileServices/Service1.svc/TestSenchaAdd?Dn=yes",
    callbackKey: 'callback',
    headers: {
    'content-type': 'application/json'
    },
    reader:{
    type:"json",
    rootProperty:"contacts"
    }

    },
    autoLoad:true

    }
    });


    The above used web service "http://10.4.3.199/FineDocsMobileServices/Service1.svc/TestSenchaAdd?Dn=yes" is giving following result in brwoser

    (
    {
    "contacts": [
    {
    "first_name": "FirstName1",
    "last_name": "LastName1"
    },
    {
    "first_name": "FirstName2",
    "last_name": "LastName2"
    }
    ]
    }
    );


    But getting the following error in Sencha touch 2 while executing the above code.

    Resource interpreted as Script but transferred with MIME type application/octet-stream: "
    http://10.4.3.199/FineDocsMobileServices/Service1.svc/TestSenchaAdd?Dn=yes&callback=?&_dc=1342784796368&page=1&start=0&limit=25&callback=Ext.data.JsonP.callback1".

    Thanks & Regards
    Vipin