4. Simplified Configuration using ( var host = new ServiceHost ( typeof ( CalculatorService ) , new Uri ( "http://localhost:1234/Service" ) , new Uri ( "net.tcp://localhost:4321/Service" ) ) ) { host.Open(); Console .WriteLine( "The service is ready." ); Console .WriteLine( "Press <ENTER> to terminate service." ); Console .ReadKey(); host.Close(); } The service is open with default binding & behaviors
45. Router Service Architecture Server C Server C Server B Client Router Service Filter Tables Filters Service A Service B Service C
46. Router Endpoints & Contracts < service name = " System.ServiceModel.Routing.RoutingService " > < endpoint name = "reqReplyEndpoint " address = "" binding = " basicHttpBinding " contract = " System.ServiceModel.Routing.IRequestReplyRouter " /> </ service >
47.
48. Message Filter Compares the "To" & Headers address to the endpoint address Compares the incoming "Action" value against the actions on the contract
49. Message Filter Compares the "To" & Headers address to the endpoint address Compares the incoming "Action" value against the actions on the contract < filters > < filter name ="addFilter" filterType ="XPath" filterData ="..." > < filter name ="addFilter" filterType ="Action" filterData ="..." > </ filters >
59. [ ServieContract ] public intrface IMedia { [ OperationContract ] Media GetMedia( Media media ); } [ DataContract ] public class Media { ... } [ DataContract ] public class DVD : Media { ... } [ DataContract ] public class CD : Media { ... } < Envelope > < Header > < Action >E4D/IMedia/GetMedia</ Action > </ Header > < Body > < GetMedia > < media type ="CD"> < Name>Madona </ Name > < Type>CDWR </ Type > </ media > </ GetMedia > </ Body > </ Envelope >