Friday, October 10, 2014
In Part One of our WCF services series we looked at how to create the contracts and implementation of our WCF/CODE Framework service. In this part we will look at how to instantiate our service end points during development using a CODE Framework Development Host.
In this exercise you will create a CODE Framework Development Host (CFDH) project. Standard WCF projects have a Service Test Harness which allows you to interact with your service, but it is limited in its functionality. The CFDH allows the developer to interact with your CODE Framework service during development, without having to deploy it and displays exceptions right in the UI. Additionally the CFDH provides service endpoints so that your client project can access the services. This provides for a highly interactive development environment.
//host.AddServiceHostBasicHttp(typeof(CustomerService), true); //host.AddServiceHostWsHttp(typeof(CustomerService), true); host.AddServiceHostNetTcp(typeof(CustomerService)); //host.AddServiceHostRestJson(typeof(CustomerService)); //host.AddServiceHostRestXml(typeof(CustomerService));
<appSettings> <!-- The following settings can be set optionally ( defaults usually suffice for development hosts) --> <!-- <add key="ServiceBaseUrl" value="localhost"/> <add key="ServiceBasePath" value="dev"/> <add key="ServiceBasePort" value="50000"/> --> </appSettings>
In Part 3 of this series we will illustrate how to access an SQL database using Entity Framework.