Hi,
I'm trying to get more familiar with AJAX, and web services, so I have created the simplest of webservices with VS2008, hello world, with a webmethod GetPaper, and am trying to get the return value "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 consume this webservice with Javascript, I get a complete HTML page as a result, not just the value!
xmlRequest.onreadystatechange = ApplyUpdate;
xmlRequest.open("GET", "http://www.linkedpapers.com/helloworld.asmx?op=GetPaper", true);
xmlRequest.send();
It's probably very simple, but I just can't seem to figure it out! Help is very much appreciated.
Regards,
Heras
edit: Or do I use a wrong URL? If so, what should I use?