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

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top