InterSystems IRIS Data Platform 2019.2  /  Using the Object Gateway for .NET

Using the Object Gateway for .NET
Setting Object Gateway Server Properties
Previous section           Next section
InterSystems: The power behind what matters   

Properties of the ObjectGateway class specify the settings used by the Service class (see “Running an Object Gateway Server”) to access and monitor an instance of the Object Gateway Server. This chapter covers the following topics:
Using the New Object Gateway Form
While it is possible to specify the settings for an Object Gateway Server session entirely in ObjectScript code, it is usually simpler to use the New Object Gateway form to create and store a persistent %Net.Remote.ObjectGateway object. The following steps summarize the configuration procedure:
  1. In the Management Portal, go to System Administration > Configuration > Connectivity > Object Gateways.
    The Object Gateways Page
    You can use the options on this page to view an Object Gateway's log of recent activity, start or stop an Object Gateway, and create, edit, or delete an Object Gateway Server definition.
  2. On the Object Gateways page, click Create New Gateway. The New Object Gateway form is displayed. Only the first three fields are required. The following example leaves the default values in place for all fields except Gateway Name, Port, and Log file (File path is set to the value that would be used if the field were left blank):
    The New Object Gateway Form
  3. Fill out the form and click Save. The following properties of ObjectGateway can be set:
  4. After saving the form, go back to the Object Gateways page. Your new Object Gateway Server definition should now be listed there.
Defining Server Properties Programmatically
The ObjectGateway server properties can also be set programmatically.
In addition to the properties defined by the New Object Gateway form (as shown in the previous section), the Type property must also be set to "2". This defines the server as a .NET Object Gateway (rather than an Object Gateway for Java).
The following example creates a server definition identical to the one generated by the New Object Gateway form described in the previous section:
 // Create the object and define it as a .NET Object Gateway
   set gw =  ##class(%Net.Remote.ObjectGateway).%New()
   set gw.Type = "2"   // an Object Gateway for .NET, not Java

 // Set the properties
   set gw.Name  = "GatewayTwo"
   set gw.Server  = ""
   set gw.Port  = "55000"
   set gw.PassPhrase = 1
   set gw.LogFile  = "C:\Temp\GatewayTwo.log"
   set gw.AllowedIPAddresses  = ""
   set gw.FilePath  = "C:\Intersystems\IRIS\dev\dotnet\bin\v2.0.50727"
   set gw.Exec64 = 1
   set gw.DotNetVersion = "2.0"
   set gw.HeartbeatInterval  = "10"
   set gw.HeartbeatFailureTimeout  = "30"
   set gw.HeartbeatFailureAction  = "R"
   set gw.HeartbeatFailureRetry  = "300"
   set gw.InitializationTimeout  = "5"
   set gw.ConnectionTimeout  = "5"

 // Save the object
   set status = gw.%Save()
The call to %Save() is only necessary if you wish to add the object to persistent storage, making it available on the Object Gateways page of the Management Portal (as described in the previous section).
Object Gateway Server Versions
Different versions of the Object Gateway Server assembly are provided for .NET 2.0 and 4.0. The following versions are shipped (where install-dir is the path that $SYSTEM.Util.InstallDirectory() returns on your system).
.NET Version 2.0:
.NET Version 4.0:
.NET Version 4.5:
In some applications, these gateways may be used to load unmanaged code libraries. Since a 64-bit process can only load 64-bit DLLs and a 32-bit process can only load 32-bit DLLs, both 32-bit and 64-bit assemblies are provided for each supported version of .NET. This makes it possible to create gateway applications for 64-bit Windows that can load 32-bit libraries into the gateway.
The appropriate version of the .NET Framework must be installed on your system in order to use these assemblies. The InterSystems IRIS installation procedure does not install or upgrade any version of the .NET Framework.

Previous section           Next section
Send us comments on this page
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-09-18 06:45:48