Hello
im using this code to create a service, works well but i can,t add the protocol and version of the protocol, how can i defined?
in aditional its posible update and existing service this core library?
Thanks
IDms dms = engine.GetDms();
int dmaId = 11111;
var agent = dms.GetAgents().First(a => a.Id == dmaId);
// Obtener elementos
var filters = new List<ElementParamFilterConfiguration>
{
new ElementParamFilterConfiguration(101,"", true),
new ElementParamFilterConfiguration(102,"filter", true),
};
// Crear servicio
ServiceConfiguration serviceConfig = new ServiceConfiguration(dms, "ServiceAutomate");
serviceConfig.Views.Add(dms.GetView(50));
serviceConfig.AddElement(new DmsElementId(11111, 446), filters);
//serviceConfig.AdvancedSettings.Protocol.Name("NombreDelProtocolo");
//serviceConfig.AdvancedSettings.Protocol.Version("1.0.0");
agent.CreateService(serviceConfig);
Hi Juan,
You will need to instantiate a IDmsProtcol object to assign a service protocol to your service. See below example:
IDms dms = engine.GetDms();
IDma dma = dms.GetAgent(123);
IDmsProtocol dmsProtocol = dms.GetProtocol("MyServiceProtocol", "Production");
ServiceConfiguration serviceConfiguration = new ServiceConfiguration(dms, "MyNewService");
serviceConfiguration.AdvancedSettings.Protocol = dmsProtocol;
dma.CreateService(serviceConfiguration);
Hope it helps.
Thanks Miguel, Works well.