Professional Documents
Culture Documents
net Web-service
A web service file creates with asmx extension. Containting web Method Hello
World.
[WebMethod]
public string square(int x)
{
String s = "";
int y = x * x;
s = y.ToString();
return s;
}
3. Generate a proxy Class for Web Service using WSDL Exe file at location
where 2188 is port number . it will depend upon machin. Yuou can get it by running your
web application.
4. Compile the Proxy Class as a DLL Library using csc.exe being at location
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
Cd C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
Run Following command
csc /t:library /r:System.Web.Services.dll /r:System.Xml.dll WebService2.cs
As output:-
WebService2.dll generates at location
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
Response.Write(s.HelloWorld());
}