calling web-service from another web-service

M

Mr. x

Hello,

I am using web-service.
In the program I did as following,
but when calling service2 while service1 isn't finished - it won't work, and
I won't get any call to myservice2().

I have problem in the line :
myrunservice2(); // *** here is the problem - this line is never reached
*** //

Thanks :)

.... What should I write instead.

Here is my code :
----------------------

<script>
// global vars
var service_fun_id;

....
function myrunservice1() // this function is called by the program.
{
service_fun_id = 1;
iCallID = service.genfuncs.callService("myfunc1");
}

function myrunservice2()
{
service_fun_id = 2;
iCallID = service.genfuncs.callService("myfunc2");
}

function onWSresult()
{
if((event.result.error)&&(iCallID==event.result.id))
{
// Pull the error information from the event.result.errorDetail
properties
var xfaultcode = event.result.errorDetail.code;
var xfaultstring = event.result.errorDetail.string;
var xfaultsoap = event.result.errorDetail.raw;
alert(event.result.errorDetail.string);
service_fun_id = -1
// Add code to handle specific error codes here
}
// if there was no error, and the call came from the call() in init()
else if((!event.result.error) && (iCallID == event.result.id))
{
runServ(event.result.value);
}
else
{
alert("Something else fired the event!");
}
}

function runServ(ares)
if (service_fun_id == 1)
{
// do something
myrunservice2(); // *** here is the problem - this line is never reached
*** //
}
else if (service_fun_id == 2)
{
// do something
}
}

....
<body>
....
<div id="service" style="behavior:url(webservice.htc)"
onresult="onWSresult()">
 

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,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top