Hi,
I am trying to build a dependency map of the protocols that are using, subscribing or communicating with other protocols in a DMS. We can find the subscriptions but we need to also look at the Elements inter-communications.
Is there a way to get the XML Code of the protocols via another C# code a Protocol?
I think it would be something similar to what DIS does when it retrieves the XML file from the server.
If not, can we query for certain XML attributes in a protocol, such as the Data Distribution attribute in a parameter?
Thanks,
Since your code is already running on the DataMiner server, I think you can simply retrieve all protocols from the C:\Skyline DataMiner\Protocols folder, and process the content of the files using the built-in XML parser of .NET.
In DIS we are using SLNet messages to retrieve the protocols from the DMA. That's probably indeed also an option here. Using the "GetInfoMessage" message (with InfoType=Protocols) you can retrieve a list of all protocols on the DMA, and using the "GetProtocolMessage" message you can retrieve the content of a specific protocol.
The GetProtocolMessage object has a Raw boolean property, but I’m not sure what it does exactly because the response seems to be the same for true and false.
To retrieve the raw protocol you’ll probably need the “GetBinaryFileContentMessage” message, with the full path to the protocol as value:
var filename = $@”C:Skyline DataMinerProtocols{name}{version}protocol.xml”;
@Tom, when the ‘Raw’ property is ‘true’ it will return the protocol without the Information Template being applied (if any).
Thanks Tom,
I tried to use the “GetProtocolMessage” to retrieve the protocol contents but I only get the protocol name and version in the returned object (GetProtocolMessage object).