PDA

View Full Version : How to call webservice from sencha touch application



nilesh.chavan
19 Jul 2011, 5:20 AM
I am very new too work on sencha touch. We have defined some categories to evaluate the sencha touch framework. So one of the task is to call web service and pull / push data to the server.

If anyone knows the syntax / sample example then please let me know.

Thanks in advanace,

Nilesh

nilesh.chavan
27 Jul 2011, 2:57 AM
How to push data to local device Sqllite run time and synchronize it with the web service on the server. Or else let me know the correct way to achieve this task.
Awaiting for response.

Thanks in advance for help!!!

zied jouini
23 Apr 2012, 1:47 PM
SALAM nilesh.
please have you found a solution to call a web service with sencha 1 ?
if you found a solution, can you post a code showing how consume a web service.
thank youuu

netresource
23 Apr 2012, 6:52 PM
refer here http://www.sencha.com/forum/showthread.php?153117-Call-an-ASP.NET-webservice-with-Sencha-Touch

(http://www.sencha.com/forum/showthread.php?153117-Call-an-ASP.NET-webservice-with-Sencha-Touch)Hope this help

zied jouini
24 Apr 2012, 2:33 AM
thank you netresource I will try this code and i will tel you the result.
thank you

zied jouini
18 May 2012, 2:27 AM
netresource salam.
i tryed this code but without success.
my url to my web service is "http://localhost:8732/log/log/admin/pass/admin" i made it with restful WCF . and its returning tha name of the client
here is what i did in my form sencha 1


App.views.BankingLogin = Ext.extend(Ext.Panel, {
scroll: 'vertical',
items: [{
xtype: 'formpanel',
id: 'form',
fullscreen: true,
cls : 'form',


items: [
{
xtype: 'fieldset',
title: 'Sign In',
},
{
xtype: 'textfield',
id : 'Login',
label: 'Login*',
placeHolder: 'login',
},
{
xtype: 'passwordfield',
id: 'password',
label: 'Password*',
useClearIcon: true,
placeHolder: 'password',
},

{
xtype: 'panel',
defaults: {
xtype: 'button',
style: 'margin: 0.1em',
flex: 1
},
layout: {
type: 'hbox'
},
items: [{
text: 'Valider',
handler: function() {
if (Ext.getCmp('Login').getValue() == '') {
Ext.Msg.alert('Impossible de se connecte', 'Login vide');
}

if (Ext.getCmp('password').getValue() == '') {
Ext.Msg.alert('Impossible de se connecte', 'mot de passe vide');
}

if (Ext.getCmp('password').getValue() == '' && Ext.getCmp('Login').getValue() == '') {
Ext.Msg.alert('Impossible de se connecte', 'Login & mot de passe vide');
}

if (Ext.getCmp('password').getValue() != '' && Ext.getCmp('Login').getValue() != '')
{

Ext.util.JSONP.request({
url: 'http://localhost:8732/log',

params: {
log: admin,
pass: admin
},
callback: function(data) {
Ext.Msg.alert("Bienvenue ",data);
}
});










}
}
}]
},


]
}]
});
Ext.reg('BankingLogin', App.views.BankingLogin);

my target is to make a cross mobile app so i used JSONP, but when i test it in my browser it doesnt work.
can you correct me the code please.
thank you