B
bjarkeriis
I have used the webservice.htc behavior in a project. It doesnt work on
the first call. While debugging i have noticed that the clientside
message is finished before the server is activated.
Apart from this it seems to work correctly, after beeing called first
time. Any ideas??
the code:
function ownRating()
{
getCookieInfoFromSession(document.getElementById("txtFilmId").value)
var ratecell = document.getElementById("rateMovie")
if(myRate=="-1")
{
ratecell.innerHTML="not rated"
ratecell.MCTempUnfocusable=false;
}
else
{
ratecell.innerHTML=("Din stemme:"+ myRate + "stjerner");
ratecell.MCTempUnFocusable=true;
document.getElementById("btnresult").value= "something happens"
}
}
var myRate
var serviceReady = false;
function init()
{
wsAnchor.useService("http://localhost/Nordjyske/wsRateCheck.asmx?WSDL","JSCookieHandler");
wsAnchor.onserviceavailable = startScript;
}
function startScript()
{
serviceReady = true;
}
function getCookieInfoFromSession(filmIdet)
{
if(!serviceReady)
alert("Servicennot ready!");
else
wsAnchor.JSCookieHandler.callService(showResult, "checkCookie",
filmIdet)
}
var result
function showResult(result)
{
if(!result.error)
myRate= result.value
// document.getElementById("btnresult").value= result.value
else
alert(result.errorDetail.string);
}
</script>
the first call. While debugging i have noticed that the clientside
message is finished before the server is activated.
Apart from this it seems to work correctly, after beeing called first
time. Any ideas??
the code:
function ownRating()
{
getCookieInfoFromSession(document.getElementById("txtFilmId").value)
var ratecell = document.getElementById("rateMovie")
if(myRate=="-1")
{
ratecell.innerHTML="not rated"
ratecell.MCTempUnfocusable=false;
}
else
{
ratecell.innerHTML=("Din stemme:"+ myRate + "stjerner");
ratecell.MCTempUnFocusable=true;
document.getElementById("btnresult").value= "something happens"
}
}
var myRate
var serviceReady = false;
function init()
{
wsAnchor.useService("http://localhost/Nordjyske/wsRateCheck.asmx?WSDL","JSCookieHandler");
wsAnchor.onserviceavailable = startScript;
}
function startScript()
{
serviceReady = true;
}
function getCookieInfoFromSession(filmIdet)
{
if(!serviceReady)
alert("Servicennot ready!");
else
wsAnchor.JSCookieHandler.callService(showResult, "checkCookie",
filmIdet)
}
var result
function showResult(result)
{
if(!result.error)
myRate= result.value
// document.getElementById("btnresult").value= result.value
else
alert(result.errorDetail.string);
}
</script>