//DNSLookupService.asmx.cs using System.Web.Services; using System.Net; [WebServices(Namespace="http://www.bostontechnical.com/webservices/", Description="<b>A web service which performs Domain Name Lookups.</b>")] publicclass DNSLookupService : System.Web.Services.WebServices { [WebMethod] publicstring getIPforHostname(string strHostname) { IPHostEntry hostInfo = Dns.GetHostByName(strHostname); return hostInfo.AddressList[0].ToString(); } }
In CMD, I do csc DNSLookupService.asmx.cs but I get
Error CS0234: The type or namespae name 'WebServices' does not exist in the namespace 'System.Web.Services' (are you jmissing an assembly referenc)? Error CS0246: The type or namespace 'WebServices' coudl not be found (are yu missing a using directive or assembly reference?
Also AFTER I compile it (once the Above problem is addddressed), is
<%@ WebService Language="C#"Class="DNSLookupService" Codebehind="DNSLookupService.asmx.cs"%>
how U write the attribute stuff in DNSLookupService.asmx?