Page 1 of 1

Interacting with a COM object, server-side

PostPosted: Thu Sep 14, 2017 4:38 pm
by joe26
Hi All,

Does the COM plugin execute server-side, when using the smart client?
Does anyone use the security.authenticate to preserve license use when executing server-side javascript?

I need to access a third party COM object from a smart-client, and am seeking to connect to it on the same server as the Servoy installation, but from a different system.
I'm running 7.4.8. The other computer's smart-client has no knowledge of the 3rd party COM. I can use the COM in the web-client, because that execution is server-side.

I have two use cases:
1. Access a 3rd party DLL, which are XML calls to a programs database for status on jobs and items, usually but not always, through web-client. Anticipate a lot of separate transactions.
2. Batch processing of text files into the Servoy database, consisting of multiple table access. Takes a long time to accomplish through smart-client, but essentially single-pass. Not interogative like #1.

This issue has been discussed in this thread: viewtopic.php?f=3&t=14815&p=78835&hilit=server+side#p78835

I'm connecting to a third party DLL, and the COM plugin is working locally.

BTW, using a 32-bit DLL within a 64-bit Java JVM was initially infeasible, but registry settings permitted even that. (Steps below) Some Windows versions support DllSurrogate out of the box, some don't, as far as I can tell. Windows Server 2008 and Windows 7 Professional currently.

thanks!
--Joe.
------------------------------------------------------------------------------------------------------------------
Activating 32-bit COM in 64-bit environment:

Be sure to use CLSID including brackets.

1. Locate your COM object GUID under the HKey_Classes_Root/Wow6432Node/CLSID

2. Once located add a new REG_SZ (string) Value. Name should be AppID and data should be the same COM object GUID you have just searched for

3. Add a new key under HKey_Classes_Root/Wow6432Node/AppID .The new key should be called the same as the com object GUID

4. Under the new key you just added, add a new REG_SZ (string) Value, and call it DllSurrogate. Leave the value empty

5. Create a new Key under HKey_Local_Machine/SoftwareClasses/AppID if it doesn't already exist. Again the new key should be called the same as the COM object's GUID. No values are necessary to be added under this key.

Re: Interacting with a COM object, server-side

PostPosted: Tue Sep 19, 2017 5:06 am
by sbutler
The COM plugin allows you to do a client or server side call. Should see that as options when you download it.

Re: Interacting with a COM object, server-side

PostPosted: Thu Sep 21, 2017 7:40 pm
by joe26
Hi Scott,

That would resolve executing the COM on the server. Having difficulty getting it to work. I've set the plugins for servoyguy, com.servoyguy.plugins.servoycom.serverLibraries, to the COM plugin application name, but still executes the client COM instead. Docs are minimal for COM objects.

Running a script through the authenticator method has not yielded results either, although the login authentication and other scripts on startup work fine.

thanks,
--Joe.

Re: Interacting with a COM object, server-side

PostPosted: Fri Sep 22, 2017 11:30 pm
by joe26
As a follow-up, the key to using security.authenticator seems to be that it must be executed with a Login-type application. Just calling security.authenticator did not work.

The COM issue, with being server-side, has an issue with 32-bit DLL vs 64-bit DLL, on a differing Java Virtual Machine on the server. Seems to default to the local if the remote fails.