Methods |
Connect(AAddressAndPort, AUserName, APassword) |
Connects to the given RPC server. AAddressAndPort - server address and port. Default value is "0.0.0.0:40404". AUserName and APassword - client authentication data. If connection fails exception will be raised. |
Disconnect |
Disconnects from the RPC server. After this method is called - all remote objects references will be invalid. For this reason before calling this method you need to destroy all remote objects references! In VBScript like this: Set MyRemoteObject = Nothing |
RequestObject(AObjectIDString as String) as Variant; |
When connected to server - remote objects can be created via this method. AObjectIDString can be any system AppID or your custom string. If AObjectIDString is your custom string - RPC server must parse this string and return object assigned with this string (custom objects ID not available in the DEMO version). |
VBScript example:
'Create RPC client object
Set RPCClient = WScript.CreateObject("RoutixRPCCOM.Client")
'Connect to the local server
RPCClient.Connect "127.0.0.1:40404", "RoutixUser", "Secret"
'Query remote object from server
Set fso = RPCClient.RequestObject("Scripting.FileSystemObject")
Const WindowsFolder = 0
Const SystemFolder = 1
Const TemporaryFolder = 2
'Call
WScript.Echo fso.GetSpecialFolder(WindowsFolder)
WScript.Echo fso.GetSpecialFolder(SystemFolder)
WScript.Echo fso.GetSpecialFolder(TemporaryFolder)
'All requested objects must be destroyed before
'RPC client will be destroyed
Set fso = Nothing
Set RPCClient = Nothing
WScript.Echo vbCRLF & "Press any key..."
WScript.StdIn.Read(1)