We have two different networks in our company, 17 and 18
- 170.17.xxx.xxx
- 170.18.xxx.xxx
On the 17 network there is a WCF service running which is discoverable. This is configured by the following code:
host.AddDefaultEndpoints();
host.AddServiceEndpoint(new UdpDiscoveryEndpoint());
EndpointDiscoveryBehavior behavior = new EndpointDiscoveryBehavior();
behavior.Scopes.Add(scope);
foreach(ServiceEndpoint endpoint in host.Description.Endpoints)
{
if(endpoint.IsSystemEndpoint || endpoint is DiscoveryEndpoint ||
endpoint is AnnouncementEndpoint || endpoint is ServiceMetadataEndpoint)
continue;
endpoint.Behaviors.Add(behavior);
}
A behavior with a scope is added to all non system endpoints and it can be discovered by sending udp packets over the network, a default instance of UdpDiscoveryEndpoint.
Clients discover the service by constructing a DiscoveryClient with a default UdpDiscoveryEndpoint.
DiscoveryClient discoveryClient = new DiscoveryClient(new UdpDiscoveryEndpoint());
FindCriteria criteria = new FindCriteria(typeof(T));
criteria.Scopes.Add(scope);
FindResponse discovered = discoveryClient.Find(criteria);
discoveryClient.Close();
This works fine when both client and service run on the same network. But I would like to have a client running on the 18 network which is able to find the service on the 17 network.
So is it possible to discover services on other networks with DiscoveryClient and UdpDiscoveryEndpoint?
edit
Or can this be a firewall issue?