Interacting with a COM object, server-side

Questions, tips and tricks and techniques for scripting in Servoy

Interacting with a COM object, server-side

Postby joe26 » Thu Sep 14, 2017 4:38 pm

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.
joe26
 
Posts: 172
Joined: Wed Jun 19, 2013 10:30 pm

Re: Interacting with a COM object, server-side

Postby sbutler » Tue Sep 19, 2017 5:06 am

The COM plugin allows you to do a client or server side call. Should see that as options when you download it.
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Training Videos
Servoy Components- Plugins, Beans, and Web Components
Servoy Guy- Tips & Resources
ServoyForge- Open Source Components
User avatar
sbutler
Servoy Expert
 
Posts: 759
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Re: Interacting with a COM object, server-side

Postby joe26 » Thu Sep 21, 2017 7:40 pm

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.
joe26
 
Posts: 172
Joined: Wed Jun 19, 2013 10:30 pm

Re: Interacting with a COM object, server-side

Postby joe26 » Fri Sep 22, 2017 11:30 pm

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.
joe26
 
Posts: 172
Joined: Wed Jun 19, 2013 10:30 pm


Return to Methods

Who is online

Users browsing this forum: No registered users and 8 guests