Z
Zeez
Hi all,
I have a webpage that calls a webservice found on a remote computer.
Below is the code of my webpage:
=====================================
<html>
<head>
<script language="JavaScript">
var iCallID;
function init()
{
service.useService("http://www.webservicex.net/length.asmx?WSDL","MyMath");
iCallID = service.MyMath.callService(onWSresult,
"ChangeLengthUnit", 12, "Feet", "Inches");
}
function onWSresult(result)
{
alert(result.value);
if((event.result.error)&&(iCallID==event.result.id))
{
var xfaultcode = event.result.errorDetail.code;
var xfaultstring = event.result.errorDetail.string;
var xfaultsoap = event.result.errorDetail.raw;
// Add code to output error information here
}
else
{
alert("The method returned the result : " + event.result.value);
}
}
</script>
</head>
<body onload="init()">
<div id="service" style="behavior:url(webservice.htc)">
</div>
</body>
</html>
=====================================
When the "alert(result.value)" is reached, I used to get "undefined" as
a result but now it seems that the webpage freezes and nothing happens.
I'm sure that the webservice I'm calling is functioning properly (if I
type its URL in a brower, it works fine) and I'm sure that the
'webservice.htc' is there in it's proper location.
Note: The above webpage is hosted on a Windows 2003 Server which has a
public IP (i don't know if this might be helpful)
Any ideas would be greatly appreciated!
Thanks
I have a webpage that calls a webservice found on a remote computer.
Below is the code of my webpage:
=====================================
<html>
<head>
<script language="JavaScript">
var iCallID;
function init()
{
service.useService("http://www.webservicex.net/length.asmx?WSDL","MyMath");
iCallID = service.MyMath.callService(onWSresult,
"ChangeLengthUnit", 12, "Feet", "Inches");
}
function onWSresult(result)
{
alert(result.value);
if((event.result.error)&&(iCallID==event.result.id))
{
var xfaultcode = event.result.errorDetail.code;
var xfaultstring = event.result.errorDetail.string;
var xfaultsoap = event.result.errorDetail.raw;
// Add code to output error information here
}
else
{
alert("The method returned the result : " + event.result.value);
}
}
</script>
</head>
<body onload="init()">
<div id="service" style="behavior:url(webservice.htc)">
</div>
</body>
</html>
=====================================
When the "alert(result.value)" is reached, I used to get "undefined" as
a result but now it seems that the webpage freezes and nothing happens.
I'm sure that the webservice I'm calling is functioning properly (if I
type its URL in a brower, it works fine) and I'm sure that the
'webservice.htc' is there in it's proper location.
Note: The above webpage is hosted on a Windows 2003 Server which has a
public IP (i don't know if this might be helpful)
Any ideas would be greatly appreciated!
Thanks