WebService Behavior problem (Service unavailable on localhost)

Discussion in 'ASP .Net Web Services' started by Cam, Jul 13, 2005.

  1. Cam

    Cam Guest

    I am running into a problem with trying to use web services in a web
    page. As an example I created a C# web service using the VS 2003
    wizard, the only change I made was to remain the namespace and service
    and uncomment the "HelloWorld" method. I compiled and tested this
    using "SimpleService.asmx" file as my start page, which creates the
    standard web page to invoke the service. This all works fine.

    So now I want to use the service in a web page using the WebService
    Behavior script and this is where I am running into trouble. The html
    is pasted below

    ===================================================================

    <html>
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html;
    charset=windows-1252">
    <title>SimpleService Test Page</title>

    <script language="JScript">
    var iCallID = 0;

    fucntion Initialize()
    {
    //Create an instance of the web service and call it SimpleService

    service.useService("http://localhost/SimpleService/SimpleService.asmx?WSDL","SimpleService");

    // Call the HelloWorld method
    iCallID = service.SimpleService.callService(DisplayResults,
    "HelloWorld);

    }

    function DisplayResults(result)
    {
    if(result.error)
    {
    var xfaultcode = result.errorDetail.code;
    var xfaultstring = result.errorDetail.string;
    var xfaultsoap = result.errorDetail.raw;

    alert("Webservice call failed\nFaultcode = " + xfaultcode +
    "\nFaultstring = " + xfaultstring + "\nFaultsoap = " + xfaultsoap);

    }
    else
    {
    alert("Webservice call success: " + result.value);
    }
    }
    </script >
    </head>

    <body onload="Initialize()">
    <div id="service" style="behavior:url(webservice.htc)"></div>
    </body>
    </html>

    ===================================================================

    So when this page loads it should call the method and display the
    returned value. What I am getting is an error where the values are

    Faultcode = Client
    Faultstring = Service unavailable


    I have tried using the actual path to the web service in the useService
    call as per Microsoft docs but this still fails. I haven't resorted to
    using a Windows Form to test the service as I need to access the
    services via a web browser.

    I've searched the web etc. but cannot find any solution. Can anyone
    help me out here.


    Cheers

    Cam
     
    Cam, Jul 13, 2005
    #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. Jiong Feng
    Replies:
    0
    Views:
    877
    Jiong Feng
    Nov 19, 2003
  2. Alex
    Replies:
    4
    Views:
    587
    Hasani Blackwell
    Feb 8, 2005
  3. =?Utf-8?B?S2VuTGVl?=
    Replies:
    5
    Views:
    2,733
  4. Dilip
    Replies:
    1
    Views:
    375
    Dilip
    Jul 18, 2003
  5. sonic_soul
    Replies:
    1
    Views:
    289
    David
    Oct 26, 2004
Loading...

Share This Page