lazhen
2025-01-09 8afe90b633046db39042aada36b88193062f8cff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Quintiq file version 2.0
#parent: #root
Method SendSystemConfigurationToDMViaSOAP (String systemName_i, String systemQProductName_i, String systemHost_i, 
  Number systemPort_i, Strings channelNames_i, String dmHost_i, 
  Number dmPort_i, String dmDatasetKind_i, String dmDatasetFolder_i, 
  String dmDatasetName_i)
{
  Description: 'Send System configuration to Data Manager Via SOAP'
  TextBody:
  [*
    // Send System configuration to Data Manager
    soapInterface := LibDMF_SOAPClient::CreateInterface();
    
    // If the system's hostname is the same with the DataManager's hostname, change it to 'localhost' instead.
    // A temporary workaround as SOAP is unable to send to the same machine using absolute hostname.
    soapDMHost := ifexpr( dmHost_i = systemHost_i, "localhost", dmHost_i );
    
    // Set the SOAP client interface such that the destination dataset of the DataManager could receive the SOAP message
    // This information was received from DataManager
    LibDMF_Util::SetSOAPClientInterfaceConfiguration( soapInterface,
                                                      soapDMHost,
                                                      dmPort_i,
                                                      "SOAPServer",                  // Name of SOAPServer
                                                      "ReceiveSystemConfiguration",  // Name of the SOAP method
                                                      dmDatasetKind_i,
                                                      dmDatasetName_i );
    
    logmessage := "Sending System's configuration to DataManager at '" + dmHost_i + ":" + [String]dmPort_i +
                  "'; Target = '" + dmDatasetKind_i + ":" + dmDatasetFolder_i + "/" + dmDatasetName_i + "' via SOAP";
    
    // No event hook required, since this method can only be triggered in a System.
    LibDMF_Util::Log( this.SystemShortName(), logmessage );
    
    soapInterface.ASync_ReceiveSystemConfiguration( systemName_i, systemQProductName_i,
                                                    systemHost_i, systemPort_i,
                                                    channelNames_i.ToString( LibDMF_CommunicationChannelRoot::ChannelNameSeparator() ),
                                                    this );
  *]
}