webservice - newbie question

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

  1. Mr. x

    Mr. x Guest

    Hello,
    I have code like this :

    file testWS.asmx :
    -------------------------
    <%@ WebService Language="C#" Class="HelloWorld" %>

    using System;
    using System.Web.Services;

    public class HelloWorld : WebService {

    [WebMethod] public String SayHelloWorld() {
    return "Hello World";
    }

    }

    file testWS.html :
    ----------------------
    <html>
    <head>
    <script language = "JSCRIPT">
    function init()
    {
    alert("0");
    service.useService("testWS.asmx?WSDL","HelloWorld");
    alert("1");
    alert(service.HelloWorld.SayHelloWorld);
    alert("2");
    }
    </script>
    </head>
    <body onload = "init()">
    </body>
    </html>

    When I try running the testWS.html .
    alert("0") is occurred, but alert("1") doesn't
    (It seems that the script falls on the line :
    service.useService("testWS.asmx?WSDL","HelloWorld") - why ?
    )

    Thanks :)
    Mr. x, Sep 12, 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. batista
    Replies:
    1
    Views:
    913
    Laurent Bugnion
    Jan 26, 2006
  2. batista
    Replies:
    0
    Views:
    562
    batista
    Jan 26, 2006
  3. Mr. x
    Replies:
    2
    Views:
    714
    Andrew
    Oct 10, 2003
  4. Cyril
    Replies:
    2
    Views:
    4,500
    Cyril
    Jun 1, 2006
  5. Mr. x

    use another webservice in a webservice

    Mr. x, Sep 26, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    142
    Mr. x
    Sep 26, 2003
Loading...

Share This Page