On the service end I have a service host spinning up in the context of a Windows service. Everything seems to go fine: the service spins up and can be discovered. But when I go to check the scope at the client that I explicitly added in the service (no matter what the value) I get the following value: {urn:http://tempuri.org/:MyServiceInterface}
The service side discovery code looks like this:
var udpDiscoveryEndpoint = new UdpDiscoveryEndpoint();
//
// Create a scope unique to this machine for filtering purposes and add it to the discovery behavior
//
var endpointDiscoveryBehavoir = new EndpointDiscoveryBehavior();
endpointDiscoveryBehavoir.Scopes.Add( new Uri( address + "/disco" ) );
udpDiscoveryEndpoint.Behaviors.Add( endpointDiscoveryBehavoir );
//
// Add discovery endpoint
//
_serviceHost.AddServiceEndpoint( udpDiscoveryEndpoint );
ServiceDiscoveryBehavior serviceDiscoveryBehavior = new ServiceDiscoveryBehavior();
_serviceHost.Description.Behaviors.Add( serviceDiscoveryBehavior );
As I guessed, you might add a metadata endpoint to your service as well? If it's the case, you should add the scope behavior to your metadata endpoint as well, so that you can discover the service with the right scope.
Cheers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With