<html>
<head>
<script language="JavaScript">
var iCallID;
function init()
{
service.useService("/services/math.asmx?WSDL","MyMath");
iCallID = service.MyMath.callService("add",5,6);
}
function onWSresult()
{
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)" onresult="onWSresult()">
</div>
</body>
</html>