Hi all,
I have added a webservice to my asp.net website. Let's say /root/WebServices/webservice.asmx. with a codefile: /root/App_Code/webservice.cs.
This works all just fine. I can invoke it calling it from a browser etx.
Now I want to test it to call it from a simple html page. I have tested it locally and it works just fine.
When I now test my local html file with the uploaded webservice it does not work and 'undefined' get's returned.
Code I use in htmpage is:
<html>
<head>
<title>webservice javascript</title>
<script language="javascript" type="text/javascript">
var callID = 0;
function InitializeService(){
service.useService("http://www.mysite.nl/WebServices/webservice.asmx?wsdl", "webservice");
}
function LookupHTML()
{
callID = service.webservice.callService("GetTextLastVote");
}
function LookupNumber()
{
callID = service.webservice.callService("GetAorB", getal.value);
}
function ShowResult()
{
resulthtml.innerHTML = event.result.value;
}
</script>
</head>
<body onload="InitializeService()" id="service" style="behavior:url(webservice.htc)" onresult="ShowResult()">get htmlcode: <input type="button" onclick="LookupHTML()" value="Klik hier"/>
<br />Get number: <input id="getal" /> <input type="button" onclick="LookupNumber()" value="Geef een getal" />
<br />
<br />
<div id="resulthtml" onresult="ShowResult()"></div>
</body>
</html>
Anyone an idea what I am missing or doing wrong?
Thanks!!