Calling Webservice from Android browser(Android 2.2) using html5

prashant_r_s

New member
Jan 4, 2012
0
0
0
Hi,

I have been working on calling a simple web service in html5 from Android Browser(Android 2.2). Its not working on Android browser. But, it works if i run it on a PC. Nothing happens when i click the button. I have been on net for couple of weeks now. But, didn't get anything to work. Below is the code of the html page. please help.

<html>
<head>
<title>UseSwap</title>
<script language="JavaScript">
function InitializeService(){
service.useService("http://localhost:2913/WebServicesUsingCSharp/WebService.asmx?wsdl",
"GetAgeService");

}
var StrYear, StrMonth, StrDay;
function GetAge(){
StrYear = document.DemoForm.StringYear.value;
StrMonth = document.DemoForm.StringMonth.value;
StrDay = document.DemoForm.StringDay.value;
service.GetAgeService.callService("GetAge", StrYear, StrMonth, StrDay);
}
function ShowResult(){
alert(event.result.value);
}
</script>
</head>
<body onload="InitializeService()" id="service"
style="behavior:url(webservice.htc)" onresult="ShowResult()">
<form name="DemoForm">
Year : <input type="text" name="StringYear"/>
Month : <input type="text" name="StringMonth"/>
Day : <input type="text" name="StringDay"/>
<button onclick="GetAge()">Get Age</button>
</form>
</body>
</html>

Regards,
Prashant.
 
Re: Calling Webservice from Android browser(Android 2.2) using ht

Your web service is running on localhost. Do you have the web service running on your Android device?
 
Re: Calling Webservice from Android browser(Android 2.2) using ht

service.useService("http://localhost:2913/WebServicesUsingCSharp/WebService.asmx?wsdl",
 

Latest posts

Trending Posts

Forum statistics

Threads
956,347
Messages
6,967,710
Members
3,163,516
Latest member
KidColoringPage