0

I am new to WCF and I am trying to understand how Services work now.

My question is simple:

I have an Interface: ICalculator

I have 2 implementations: StandardCalculator : ICalculator and FunkyCalculator : ICalculator

And I would like to know how I can expose this (code wise) so that the URL's are like this:

hxxp://localhost:8000/Calculator/Simple

hxxp://localhost:8000/Calculator/Funky

If this is not possible to do I would like to understand why.

pnuts
  • 58,317
  • 11
  • 87
  • 139
dagadbm
  • 91
  • 5
  • This looks more like a RESTful Web API to me. Perhaps ASP.NET Web API is a better fit? – Steven Jul 10 '13 at 15:11
  • oh I see. So WCF was not created for this kind of thing then. Is it even possible to do it? – dagadbm Jul 10 '13 at 15:12
  • It is [certainly possible](https://www.google.com/search?q=WCF+Rest) to do REST with WCF. [Here is a discussion](http://stackoverflow.com/questions/9502548/wcf-service-or-web-api) about picking WCF REST or Web API. – Steven Jul 10 '13 at 15:40
  • You have two different implementations of one contract, so you have two different services. Ergo, you'll need two separate service hosts. You could use multiple endpoints for a **single** service (a single implementation of a single contract). – Tim Jul 10 '13 at 19:13
  • @Steven - I disagree that this looks RESTful; this looks like a standard WCF SOAP to me. – Tim Jul 10 '13 at 19:15

0 Answers0