calling web-service from another web-service

Discussion in 'ASP .Net Web Services' started by Mr. x, Sep 29, 2003.

  1. Mr. x

    Mr. x Guest

    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()">
    Mr. x, Sep 29, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hocho888
    Replies:
    1
    Views:
    619
  2. Michael Averstegge
    Replies:
    0
    Views:
    4,217
    Michael Averstegge
    Jan 10, 2006
  3. Replies:
    1
    Views:
    232
    Joe Kaplan \(MVP - ADSI\)
    Jun 14, 2006
  4. JC

    Calling a web service from a web service

    JC, Aug 16, 2003, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    120
    Tom Vande Stouwe MCSD.net
    Aug 20, 2003
  5. Tony T.

    Calling an Asynch web service within a web service.

    Tony T., Apr 26, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    189
    Tony T.
    Apr 26, 2004
Loading...

Share This Page