View Full Version : Consuming ASP.NET Web Service

15 Sep 2011, 2:29 PM
Hi Guys,

I am new to Sencha family, so please ignore my lack of knowledge. This question may have been answered before but I couldn't find a good solution to my problem.

I need to be able to consume ASP.NET web services in a Sencha Touch application. My web service is given below and URL for testing is at:

http://sencha.mussanisoft.com/webservice/service.asmx (http://sencha.mussanisoft.com/webservice/service.asmx)

<WebMethod()> _
<ScriptMethod(ResponseFormat:=ResponseFormat.Json, UseHTTpGet:=True)> _
Public Function HelloWorldJSON(ByVal myName As String) As String
Return "JSON Hello - " & myName
End Function
My .js file code is given below:

var rootPanel;
onReady: function () {
var HW = new Ext.Component({
title: "Hello World",
tpl: [
' <div>',
' <p>{text}</p>',
' </div>'
var HWParam = {
stlye: "background-color: #FFBF00; color:white;",
title: "HW Param", html: "Hello World with Param"
var HWJSON = {
stlye: "background-color: #3B7E00; color:white;",
title: "HW JSON", html: "Hello World JSON"

rootPanel = new Ext.TabPanel({
fullscreen: true,
cardSwitchAnimation: { type: 'fade', duration: 500 },
layout: 'card',
items: [HW, HWParam, HWJSON]

refresh = function () {
url: 'http://sencha.mussanisoft.com/webservice/service.asmx/HelloWorldJSON',
method: 'GET',
params: { myName: 'john' },
jsonData: { "Alert": {} },
headers: { 'Content-Type': 'application/json;charset=utf-8' },
failure: function (response) {
data = Ext.decode(response.responseText);
Ext.Msg.alert('Error', data.errorMessage);
success: function (response, opts) {
data = Ext.decode(response.responseText);

var myText = {
text: "my static text"

The problem is that I don't think this code is calling the web service at all. I don't get the alerts from either the failure or success functions. I am not even sure that the code written to call the web service is correct or not.

Please help with some code example on how to GET and POST data from ASP.NET web services.


12 Oct 2011, 1:45 AM
I'd like to have this question answered too.

I want to display data rows in a sencha touch list

Thank you