Sunday, February 8, 2009

WCF & ASP.NET 3.5 Web Services [Part One]

WCF & ASP.NET 3.5 Web Services [Part One]

Question 1: How are ASP.NET web services set to work with ASP.NET AJAX scripts?

The attribute [System.Web.Script.Services.ScriptService] is set for the class of each web service. This attribute indicates that a web service may be invoked from script.

Example:

[WebService(Namespace = "http://www.aspcert.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)][System.Web.Script.Services.ScriptService]
public class WebService1 : System.Web.Services.WebService
{
[WebMethod]
public string HelloWorld( )
{
return "Hello World";
}
}



Original questions authored by G. R. Roosta

No comments:

Post a Comment