service unavailable

Discussion in 'JavaScript and AJAX' started by mariechristine, Aug 3, 2006.

Thread Status:
Not open for further replies.
  1. mariechristine

    mariechristine New Member

    Joined:
    Aug 3, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    I am trying to invoke a webservice from javascript.

    When I work locally (html and javascript on my PC) calling the webservice on a remote pc, it is successfully working. However, when I put the htm & javascript on another pc and I open the page using ip of other pc, I am getting "Service unavailable" error!

    Do you have any idea?


    The following is the code I am using:
    HTML:
    <HTML>
    <HEAD>
    <SCRIPT language="JavaScript">
    function init()
    {
    service.onServiceAvailable = alertReady;
    service.useService("http://webservices.codingtheweb.com/bin/qotd.wsdl","quote"); 
    }
    
    function alertReady() {
    alert("Ready");
    }
    
    function getQuote() {
    service.quote.callService(onmyresult,"getQuote");
    }
    
    function onmyresult(result)
    {
    if (!result.error) {
    service.innerHTML = result.value;
    }else{
    service.innerHTML = "Error: " + result.errorDetail.code + " " + result.errorDetail.string + " " + result.errorDetail.raw;
    }
    }
    </SCRIPT>
    </HEAD>
    <BODY onload="init()">
    <button onclick="getQuote()">Get Quote of the Day</button> 
    <div id="service" style="behavior:url(htc/webservice.htc)"></div>
    </BODY>
    </HTML>
    :(
     
    Last edited by a moderator: Aug 3, 2006
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,376
    Likes Received:
    388
    Trophy Points:
    83
    Please do not post your queries under the Articles and source code section.

    Duplicate of [thread=1117]service unvailable[/thread]. Thread closed.
     
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice