Dura Soft
.NET-74
Writing a Web Service
•Write a web service source with .asmx
<%@ WebService Language="C#"
Class= "TemperatureProvider" %>
using System;
using System.Web.Services;
[WebService(Namespace="http://www.durasoftcorp.com")]
public class TemperatureProvider
{
[WebMethod]
public double temperature(string city)
{
// Ideally we would fetch this information
// from our resources.
return new Random().NextDouble() * 100;
}
}