<?xml version="1.0" encoding="utf-8" ?>
<configuration> <system.serviceModel> <services> <service name ="CarManagementService.CarManagementImplementation" behaviorConfiguration="ExposeMetaDataBehavior"> <endpoint address="" binding="wsHttpBinding" bindingConfiguration="AllowBigMessageSize" contract="CarManagementInterface.ICarManagement" /> </service><service name ="CustomerService.CustomerImplementation">
<endpoint address="" binding="wsHttpBinding" contract="CustomerInterface.ICustomer" /> </service><service name ="RentalService.RentalImplementation">
<endpoint address="" binding="wsHttpBinding" contract="RentalInterface.IRental" /> </service><service name ="ExternalInterfaceFacade.ExternalInterfaceFacadeImplementation">
<endpoint address="" binding="wsHttpBinding" contract="ExtenalInterface.IExtenalInterface" /> </service> </services><behaviors>
<serviceBehaviors> <behavior name="ExposeMetaDataBehavior"> <serviceMetadata httpGetUrl="" httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors><bindings>
<wsHttpBinding> <binding name="AllowBigMessageSize" maxReceivedMessageSize="999999" > </binding> </wsHttpBinding> </bindings> </system.serviceModel></configuration>--------------------------
static ServiceHost CarManagementServiceHost;
static ServiceHost CustomerServiceHost; static ServiceHost RentalServiceHost; static ServiceHost ExtentalServiceHost; static void Main(string[] args) { CarManagementServiceHost = new ServiceHost(typeof(CarManagementService.CarManagementImplementation)); CarManagementServiceHost.Open();CustomerServiceHost = new ServiceHost(typeof(CustomerService.CustomerImplementation));
CustomerServiceHost.Open();RentalServiceHost = new ServiceHost(typeof(RentalService.RentalImplementation));
RentalServiceHost.Open();ExtentalServiceHost = new ServiceHost(typeof(ExternalInterfaceFacade.ExternalInterfaceFacadeImplementation));
ExtentalServiceHost.Open();Console.WriteLine("服务已经启动...");
Console.ReadKey(); }