Reputation: 9232
So we have recently moved much of our business logic into a service layer, which has led us to refactor the services we have exposed as API services. I consider myself experienced enough with WCF, but of course there is always more learning to be done. What I am interested in finding out, is not really something I can find in a book?
If we have a service ReturnService that we want to expose, but we want to expose it over SOAP and over REST, what is the best practice for doing this? Until now, I have always just created two implementations and interfaces, which goes against my preaching to use a single interface for multiple implementations.
I am not sure how I would use one interface for both implementations being that I need to specify the service specific information on the interface.
Upvotes: 1
Views: 766
Reputation: 6563
I guess you can not use single Service Contract for both. Instead you can have two Service Contracts and implement both in single class.
Please read this article will help you.
This article is a step by step on doing exactly what you are asking about, exposing both REST and SOAP. The article exposes the REST in JSON format.
Upvotes: 1