Posts

Showing posts from March 7, 2011

WCF 4.0 routing with MetadataExchange using System.ServiceModel.Routing.RoutingService in F#

I posted a simple question on stackoverflow.com: I have service with working MEX at: net.tcp://remotehost:4508 What is the shortest C#/F# code (hard time understanding XML configuration files ^_^") I could write to create a router to it at?: net.tcp://localhost:4508 MEX should also be routed properly so that clients can use the router svcutil net.tcp://localhost:4508 to discover service methods. and as has been usual with its users no one has been able to answer my question before I could come up with my own answer. Here's how to use F# and WCF 4.0 to route a service with NetTcp and MexTcp endpoints no XML involved, pure code: namespace CORSISmodule Application =    open System    open System.ServiceModel    open System.ServiceModel.Routing    open System.ServiceModel.Dispatcher    open System.ServiceModel.Description    let createSimpleRouter createBinding (routerAddress : string) serviceAddress =         let routerType = typeof<IReq