When i ran my application in android phone and send request to server at that time i get error - requested url not found (404 error). Same application i ran into browser it works perfect.
Code for calling web service
getLoginDetails(username,password) {
var sRequest1 = '<MRREQ><REQTYPE>LOGIN</REQTYPE><USERID>'+ username +'</USERID><PASSWORD>'+ password +'</PASSWORD></MRREQ>';
//var data = JSON.stringify({sRequest: sRequest1});
//console.log('sRequest',data);
let headers = new Headers();
headers.append('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
debugger;
return this.http.post(`${this.link}/DoLogin`,'sRequest=' + sRequest1,{ headers: headers });
}
Configue.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.ionic.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>NRA_Hybrid</name>
<description>An Ionic Framework and Cordova project.</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="15" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashScreenDelay" value="2000" />
<preference name="FadeSplashScreenDuration" value="1000" />
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar" />
</feature>
<plugin name="cordova-plugin-console" spec="~1.0.3" />
</widget>