Calling PowerServer open interfaces via .NET component

PowerServer open interfaces (methods) in .NET are encapsulated in a standard .NET component. To call the .NET component, Appeon provides a non-autoinstantiated NVO - AppeonDotNetComponent - as the proxy object to call the server-side component. Details refer to the section called “Calling .NET/COM server components (.NET only)”.

Following is general step guide to write code in PowerBuilder to invoke the open interface.

Step 1: Load Appeon Workarounds PBL to the application.

Step 2: Make sure the .NET/COM components have been registered using the regsvr32 tool and the components have been copied to the %appeon%/AEM/components folder on the PowerServer machine.

Step 3: Create an instance of AppeonDotNetComponent. For example:

String servername, appname 
AppeonDotNetComponent loadDBList 
Any la_l[] 
Long lRet 
serverName = "" 
appname = "" 
la_l[1] = servername
la_l[2] = appname
loadDBList = Create AppeonDotNetComponent

Step 4: Specify the ComponentType and set the TypeLib property and the ClassDescript property to empty. For example:

loadDBList.ComponentType = "4" 
loadDBList.TypeLib = "" 
loadDBList.ClassDescript = ""

Step 5: Invoke one or more open interfaces in the component. For example:

lRet = loadDBList.of_ExecInterface ("getSessionCount", la_l) 
If lRet = 0 Then 
MessageBox ("Get session count successfully.", "Session Count:" + string(loadDBList.ReturnValue)) 
End If

Step 6: Deploy the PowerBuilder application to PowerServer the same way you would deploy a normal PowerBuilder application.

The above code will take effect in the Appeon-deployed application.