Utilisation de REOverride pour spécifier un environnement distant
Pour spécifier par programmation un RE, l’application utilise l’entrée de contexte managé. La propriété de contexte doit avoir la valeur true sur la méthode à partir du concepteur.
Le code Visual Basic suivant montre un exemple de création virtuelle d’un RE dans l’application.
' You must set the following references in your project:
' Microsoft.HostIntegration.TI.ClientContext.dll
' Microsoft.HostIntegration.TI.Globals.dll
Imports Microsoft.HostIntegration.TI
Dim TIContext As New ClientContext
Dim DynamicRE As ELMLinkRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.ELMLink, "MyRE")
DynamicRE.IPAddress = SystemAddress
DynamicRE.TCPPorts = PortNumber
TIContext.DynamicRE = DynamicRE
Obj.Method1 parm1, parm2, parm3, TIContext
Le code Visual Basic suivant montre un exemple de HTTP utilisant MSHMIRS.
Dim DynamicRE As HTTPLinkRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.HttpLink, "MyRE")
DynamicRE.IPAddress = SystemAddress
DynamicRE.HttpPort = PortNumber
DynamicRE.MirrorProgramName = "MSHMIRS"
DynamicRE.AliasTransactionId = "CWBA"
TIContext.DynamicRE = DynamicRE
Le code Visual Basic suivant montre un exemple de données utilisateur HTTP.
Dim TIContext As New ClientContext
Dim DynamicRE As HTTPUserDataRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.HttpUserData, "MyRE")
DynamicRE.IPAddress = SystemAddress
DynamicRE.HttpPort = PortNumber
DynamicRE.AliasTransactionId = "CWBA"
TIContext.DynamicRE = DynamicRE
Le code Visual Basic suivant montre un exemple de lien CICS.
Dim TIContext As New ClientContext
Dim DynamicRE As SNALinkRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.SNALink, "MyRE")
DynamicRE.LocalLUName = LocalLUName
DynamicRE.RemoteLUName = RemoteLUName
DynamicRE.ModeName = Mode
TIContext.DynamicRE = DynamicRE
Le code Visual Basic suivant montre un exemple de données utilisateur CICS LU6.2.
Dim TIContext As New ClientContext
Dim DynamicRE As SNAUserDataRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.SNAUserData, "MyRE")
DynamicRE.LocalLUName = LocalLUName
DynamicRE.RemoteLUName = RemoteLUName
DynamicRE.ModeName = Mode
TIContext.DynamicRE = DynamicRE
Le code Visual Basic suivant montre un exemple d’IMS LU 6.2.
Dim TIContext As New ClientContext
Dim DynamicRE As SNAUserDataRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.IMSLU62, "MyRE")
DynamicRE.LocalLUName = LocalLUName
DynamicRE.RemoteLUName = RemoteLUName
DynamicRE.ModeName = Mode
TIContext.DynamicRE = DynamicRE
Le code Visual Basic suivant montre un exemple de lien ELM.
Dim TIContext As New ClientContext
Dim DynamicRE As ELMLinkRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.ELMLink, "MyRE")
DynamicRE.IPAddress = SystemAddress
DynamicRE.TCPPorts = PortNumber
TIContext.DynamicRE = DynamicRE
Le code Visual Basic suivant montre un exemple de liaison TRM avec Security.
Dim TIContext As New ClientContext
Dim DynamicRE As TRMLinkRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.TRMLink, "MyRE")
DynamicRE.IPAddress = SystemAddress
DynamicRE.TCPPorts = PortNumber
DynamicRE.Security = RemoteEnvironmentSecurity.User
TIContext.DynamicRE = DynamicRE
TIContext.User = "UserId"
TIContext.Password = "Password"
Le code Visual Basic suivant montre un exemple de données utilisateur TRM avec Security.
Dim TIContext As New ClientContext
Dim DynamicRE As TRMUserDataRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.TRMUserData, "MyRE")
DynamicRE.IPAddress = SystemAddress
DynamicRE.TCPPorts = PortNumber
DynamicRE.Security = RemoteEnvironmentSecurity.User
TIContext.User = "UserId"
TIContext.Password = "Password"
TIContext.TransactionId = "CICS Transaction name"
TIContext.DynamicRE = DynamicRE
Le code Visual Basic suivant montre un exemple d’IMS Connect sans sécurité, quittez HWSIMSO0.
Dim TIContext As New ClientContext
Dim DynamicRE As IMSConnectRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.IMSConnect, "MyRE")
DynamicRE.IPAddress = SystemAddress
DynamicRE.TCPPorts = PortNumber
DynamicRE.ItocExitName = "*IRMREQ*"
DynamicRE.OtmaSystemId = "IMS system ID"
TIContext.DynamicRE = DynamicRE
Le code Visual Basic suivant montre un exemple d’IMS Connect avec sécurité, quitter HWSIMSO1.
Dim TIContext As New ClientContext
Dim DynamicRE As IMSConnectRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.IMSConnect, "MyRE")
DynamicRE.IPAddress = SystemAddress
DynamicRE.TCPPorts = PortNumber
DynamicRE.ItocExitName = "*IRMRE1*"
DynamicRE.OtmaSystemId = "IMS system ID"
DynamicRE.Security = RemoteEnvironmentSecurity.Off Or RemoteEnvironmentSecurity.ImsHWS01SecurityExit
TIContext.DynamicRE = DynamicRE
Le code Visual Basic suivant montre un exemple de système d’exploitation 400 avec le nom de la bibliothèque et de la sécurité.
Dim TIContext As New ClientContext
Dim DynamicRE As DPCRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.DistributedProgramCall, "MyRE")
DynamicRE.IPAddress = SystemAddress
DynamicRE.TCPPorts = PortNumber
DynamicRE.Security = RemoteEnvironmentSecurity.User
TIContext.User = "UserID"
TIContext.Password = "Password"
TIContext.LibraryName = "Library Name"
TIContext.DynamicRE = DynamicRE