Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here's my answer to my question that does exactly what I want - without any XML salad, in less then 50 lines of F#:</p> <pre><code>namespace CORSIS module 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&lt;IRequestReplyRouter&gt; let routerContract = ContractDescription.GetContract(routerType) let endpoint address = new ServiceEndpoint(routerContract, createBinding(), new EndpointAddress(address)) let serviceEndpoints = [| endpoint serviceAddress |] let configuration = new RoutingConfiguration() configuration.FilterTable.Add(new MatchAllMessageFilter(), serviceEndpoints) let host = new ServiceHost(typeof&lt;RoutingService&gt;) ignore &lt;| host.AddServiceEndpoint(routerType, createBinding(), routerAddress) host.Description.Behaviors.Add(new RoutingBehavior(configuration)) host [&lt;EntryPoint&gt;] let main(args) = let (routerAddress, serviceAddress) = match args with | [| ra; sa |] -&gt; (ra, sa) | _ -&gt; ("net.tcp://localhost:4508/", "net.tcp://remotehost:4508/") let netTcp() = new NetTcpBinding(SecurityMode.None) let mexTcp() = MetadataExchangeBindings.CreateMexTcpBinding() let tcpRouter = createSimpleRouter netTcp routerAddress serviceAddress let mexRouter = createSimpleRouter mexTcp (routerAddress + "mex") (serviceAddress + "mex") tcpRouter.Open() mexRouter.Open() Console.WriteLine("routing ...\n{0} &lt;-&gt; R:{1}", serviceAddress, routerAddress) ignore &lt;| Console.ReadKey true 0 </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload