webservice.htc doesnt work on first call

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top