A simple GreatestCommonDivisor service in C# - Part2
What if we wanted to consume our previously built GCD Service by a web browser, such as Internet Explorer? ... Nothing easier than that. In fact, with minimal effort we can implement this functionality. Firstly, we have to (1) declare that our service supports the HTTPQuery operation, secondly we have to (2) implement a handler for this HTTPQuery request, and thirdly we may (3) test the service with a browser. 1. Just add the HTTPQuery port to the GCD service's port set, which is defined in GCDTypes.cs (assuming that your service is named GCD). [ServicePort()] public class GCDOperations : PortSet {} So now that we have declared that our service is capable of understanding a HttpQuery action, we need to implement a routine, which handles such HttpQuery requests - a HTTPQueryGCDHandler. 2. Add the following lines to the GCD.cs [ServiceHandler(ServiceHandlerBehavior.Concurrent)] public virtual IEnumerator HTTPQueryGCDHandler(HttpQuery httpQuery) { if (! string .IsNullOrEmpty(htt...