using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ServiceModel; namespace Service { [ServiceContract(Name="Service_Calucator",Namespace="Henllyee")] publicinterface ICalucator { [OperationContract] int Add(int x, int y); } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ServiceModel; namespace Service { [ServiceContract(Name="Service_Calucator",Namespace="Henllyee")] publicinterface ICalucator { [OperationContract] int Add(int x, int y); [OperationContract] double Add(double x, double y); } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ServiceModel; namespace Service { [ServiceContract(Name="Service_Calucator",Namespace="Henllyee")] publicinterface ICalucator { [OperationContract(Name="IntAdd")] int Add(int x, int y); [OperationContract(Name="DoubleAdd")] double Add(double x, double y); } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ServiceModel; using Service; namespace Host { class Program { staticvoid Main(string[] args) { ServiceHost host =null; try { host =new ServiceHost(typeof(Calucator)); host.Open(); Console.Write("Host is opening now! Press any key to stop"); Console.Read(); } finally { host.Close(); } } } }