I'm trying to get to know AJAX and web services, so I created the simplest of web services with VS2008, hello world, using the webmethod GetPaper and try to get the return value of "hello world".
<%@ WebService Language="C#" Class="HelloWorld" %> using System; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.Web.Script.Services.ScriptService] public class HelloWorld : System.Web.Services.WebService { [WebMethod] public string GetPaper() { return "Hello World"; } }
http://www.linkedpapers.com/helloworld.asmx
However, when I use this web service with Javascript, I end up with a full HTML page, not just the value!
xmlRequest.onreadystatechange = ApplyUpdate; xmlRequest.open("GET", "http://www.linkedpapers.com/helloworld.asmx?op=GetPaper", true); xmlRequest.send();
This is probably very simple, but I just can't figure it out! Help is much appreciated.
Hi,
Heras
edit: Or am I using the wrong URL? If so, what should I use?
Heras source share