-
17 Jul 2012 5:37 AM #1
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
-
19 Jul 2012 4:15 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,710
- Vote Rating
- 436
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.
-
20 Jul 2012 4:09 AM #3
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
-
23 Jul 2012 1:00 AM #4
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
Originally Posted by vipsshan;
857788


Reply With Quote