2012-03-06 14 views
0

這裏是我的代碼,我使用從網絡服務中獲取數據: -沒有獲得成功,從煎茶觸摸調用asp.net web服務

Ext.onReady(function(){ 
     var url = "http://192.168.1.15/JSONDemo/Service1.asmx/getString"; 
    Ext.Ajax.request({ 

     method: 'get', 
     url: url, 
    // params: {'name':'himanshu'}, 
     jsonData: { 'name': 'Himanshu'}, 
    // headers: { 'Content-Type': 'application/xml; charset=utf-8' }, 
     success: function (response, request) { 
     alert('Working!') 
     alert(response.responseText) 
     console.log('Response:-'+response.responseText) 
     }, 
     failure: function (response, request) { 
     alert('Not working!') 
     console.log('Response Status:-'+response.status) 
     } 
     }); 
}); 

我的.NET Web服務代碼是在這裏: -

[WebMethod] 
     [ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = true)] 
     public string getString(string name) 
     { 
      return "Hello "+name; 
     } 

我沒有得到這個代碼'0'響應status.Please幫助我擺脫問題的反應。

回答

0

您能否使用Web瀏覽器從您的服務中獲取數據? 使用http get時,應將參數傳遞給查詢字符串中的方法。 sencha傳遞查詢字符串中的參數嗎? 致以問候