Question

I'm trying to combine the WCF Routing Service with Discovery but it seems that they can't work together. This is my scenario:

A request from the client comes in at the routing service. I want the routing service to use discovery to find the correct endpoint and send the incoming message to the found endpoint. However the routing service sends a [http://tempuri.org] namespace to the discovery service and therefore the discovery service can not find a service by that namespace because it expects the namespace of the incoming message on the router service.

I know that I configured the discovery service correctly because it can resolve the endpoint if I use the discovery configuration on the client side. However discovery on the client side is not possible in my production scenario. Also the router service works if I do not use discovery to resolve the endpoint.

This is my routing and discovery configuration:

<routing>
  <filters>
    <filter name="GreetingsFilter" filterType="EndpointName" filterData="GreetingsRoutingEndpoint"/>
  </filters>
  <filterTables>
    <filterTable name="DefaultTable">
      <add filterName="GreetingsFilter" endpointName="GreetingsDiscoveryEndpoint"/>
    </filterTable>
  </filterTables>
</routing>

<client>
  <endpoint behaviorConfiguration="LoggingBehavior" binding="basicHttpBinding"
    contract="*" name="GreetingsDiscoveryEndpoint"
    kind="dynamicEndpoint" endpointConfiguration="dynamicEndpointConfiguration" />
</client>

<standardEndpoints>
  <dynamicEndpoint>
    <standardEndpoint name="dynamicEndpointConfiguration">
      <discoveryClientSettings>
        <endpoint address="http://server/DiscoveryProxy.svc" behaviorConfiguration="DiscoveryEndpointBehavior" binding="wsHttpBinding" bindingConfiguration="NoSecurityBinding" name="DiscoveryEndpoint" kind="discoveryEndpoint" endpointConfiguration="managedDiscoveryEndpointConfiguration"/>
      </discoveryClientSettings>
    </standardEndpoint>
  </dynamicEndpoint>

  <discoveryEndpoint>
    <standardEndpoint name="managedDiscoveryEndpointConfiguration" discoveryVersion="WSDiscovery11" discoveryMode="Managed"/>
  </discoveryEndpoint>
</standardEndpoints>

And here is a fiddler picture that shows what is being send to the discovery service. (notice the [http://tempuri] namespace): Fiddler screenshot showing the [http://tempuri] namespace being send to the discovery service

Can somebody advice me if my scenario is possible and how?

Was it helpful?

Solution

I found the solution. I had to specify search criteria in the discoveryClientSettings element. Here I could explicitly say which types I'm looking for. My standardEndpoints config now looks like the following:

<standardEndpoints>
  <dynamicEndpoint>
    <standardEndpoint name="dynamicEndpointConfiguration">

      <discoveryClientSettings>
        <endpoint address="http://server/DiscoveryProxy.svc" behaviorConfiguration="DiscoveryEndpointBehavior" binding="wsHttpBinding" bindingConfiguration="NoSecurityBinding" name="DiscoveryEndpoint" kind="discoveryEndpoint" endpointConfiguration="managedDiscoveryEndpointConfiguration" />
        <findCriteria>
          <types>
            <add name="IGreetingService" namespace="urn:poc:igreetingservice:v1"/>
          </types>
        </findCriteria>
      </discoveryClientSettings>
    </standardEndpoint>
  </dynamicEndpoint>


  <discoveryEndpoint>
    <standardEndpoint name="managedDiscoveryEndpointConfiguration" discoveryVersion="WSDiscovery11" discoveryMode="Managed"/>
  </discoveryEndpoint>
</standardEndpoints>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top