I working with onvif cameras but have a few issues with discovery.
Using very basic discovery code as below I get reply's from most of the devices on our network but a few are being discarded. I've added trace logging and i can see the messages being discarded by the discovery client with the description
A ProbeMatches message with messageId='uuid:xxx' and relatesTo='uuid:xx' was dropped by the DiscoveryClient because either the corresponding Find operation was completed or the relatesTo value is invalid.
Looking at the relatesTo value in the trace and also in MS Network Monitor they seem to be exactly the same and the ones that are getting dropped are in the first few replies so i dont think they are after the operation has completed.
I have also run up the onvif device manager that is on sourceforge, this has the same problems but with different devices, has anybody come across this before or have any ideas what could be causing it.
public void TryToDiscoverClients()
{
System.Net.ServicePointManager.Expect100Continue = false;
var endPoint = new UdpDiscoveryEndpoint(DiscoveryVersion.WSDiscoveryApril2005);
var discoveryClient = new DiscoveryClient(endPoint);
discoveryClient.FindProgressChanged += discoveryClient_FindProgressChanged;
FindCriteria findCriteria = new FindCriteria();
findCriteria.Duration = TimeSpan.MaxValue;
findCriteria.MaxResults = int.MaxValue;
findCriteria.ContractTypeNames.Add(new XmlQualifiedName("NetworkVideoTransmitter", @"http://www.onvif.org/ver10/network/wsdl"));
findCriteria.ContractTypeNames.Add(new XmlQualifiedName("Device", @"http://www.onvif.org/ver10/device/wsdl"));
discoveryClient.FindAsync(findCriteria);
}
private void discoveryClient_FindProgressChanged(object sender, FindProgressChangedEventArgs e)
{
Results.Add(e);
}