Reputation: 602
I am trying to invoke local service using following code on Android Emulator. Bellow is the JavaScript code to invoke the service.
Ext.Ajax.request({
url: "http://10.0.2.2/MyService.svc/Authenticate",
jsonData: data,
headers: {
"X-Authorization-Elf" : SessionManager.getCurrentSessionToken()
},
scope: scope,
success: function (response, options) {
},
failure: function(response, options) {
},
callback: function (options, success, response) {
// Hide the loading message box
Ext.Viewport.setMasked(false);
}
});
Call is not reaching to service. Application flow is going to failure case with status 0 and response text as empty.
Please suggest me the approach.
Upvotes: 1
Views: 620
Reputation: 541
Did you add the host to the phonegap/cordova xml??
try adding this line to the phonegap/cordova xml in res/xml folder:
<access origin="http://10.0.2.2*"/>
If you are using phonegap 2.0.0 add it to the config.xml
Upvotes: 1
Reputation: 1759
I think, your application is not able to connect to the url you have provided. You can add breakpoint in ur server side class and debug if your server class is getting called.
Upvotes: 0