Invoking another server component’s methods – PB Docs 70

Invoking another server component’s methods

Jaguar allows the methods of one server component to call
methods of another server component. The other server component
does not need to be another PowerBuilder component; it can be implemented
in any language supported by Jaguar.

Accessing a component in the current server

To access methods of another Jaguar component in the current
server, you can use the Connection object to communicate with the
component, just as you would from a PowerBuilder client. Alternatively,
you can use the transaction service context object that PowerBuilder
provides called TransactionServer. The TransactionServer
interface provides a method called CreateInstance that allows you
to access other components that are available locally. CreateInstance
uses the same user and password information that applies to the component
from which it is called.

Before you can use the transaction context service, you need
to declare a variable of type TransactionServer and call the GetContextService
function to create an instance of the service.

Example In the Activate event for a component, you could call GetContextService
to instantiate the TransactionServer service:

In one of the component methods, you could then call CreateInstance
to instantiate the second component and call one of its methods:

Accessing a component in a different server

The procedure for accessing a server component on a different
server is essentially the same as the procedure for accessing a
server component from a PowerBuilder client. To access a Jaguar
component on a different server, you need to create a Connection
object, set properties for the Connection object, and call ConnectToServer.

Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x