webservice - newbie question

M

Mr. x

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 :)
 

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,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top