Hi all,
today I will give you an example of a single WCF application exposing data with the following endpoints at the same time:

SOAP 1.1 (basicHttpBinding)

SAOP 1.2 (wshttpBinding)

REST XML

REST JSON

So, the WCF service I propost it is hosted by Visual Studio itself as well as a Windows Service. You can download the solution here.
Once you run the solution (remember to run Visual Studio as admin!), you can test SOAP endpoints by Visual Studio WCF Test Client (that will automatically start) and REST endpoints copying paste into your web browser the following URLs:

Contracts: it defines the WCF Service contract, I mean the data (dto object) exposed outside the service, the Fault classes describing errors, and the service interface

Dal: it could be Entity Framework or something else that is able to retrieve data from a DataBase. In this example this Dll is empty, I didn’t realized a complex example. However it is clear that the DAL will be not exposed outside the service as is, but it will mapped into Data Contracts object.

Service Host: in this sample you can install the WCF Service as a Windows Service. The Install.bat and Uninstall.bat will do the job for you!

Services: the service implementation itself. You could set it as a Startup Project in fact if we take a look at the project we can see that Visual Studio will host the service and it will starts the WCFTest client as well on startup:

Here you are the most interesting part: the App.config which is the same for the Service (when hosted by Visual Studio) and the Host program: