Chapter 12 Calling EAServer Component Methods from PowerDynamo
Setting up PowerDynamo as a client
For PowerDynamo to access EAServer as a client,
the machine on which PowerDynamo is installed must be set up properly.
This setup depends on the type of calls that the Dynamo client will
be making to EAServer:
EAServer client software
To call EAServer components from
PowerDynamo, you must install the client software (select Runtime),
when installing EAServer.
Setting up PowerDynamo to use EAServer components through ActiveX
To access an EAServer component with ActiveX
objects:
- Install Jaguar Manager on the Dynamo machine.
- Install the ActiveX Proxy Automation
Server using the client installation program on the Dynamo machine.
- From Jaguar Manager, connect to the
EAServer that contains the required components.
- Generate TLB/REG files for
the package. This generates ActiveX proxy objects that you can then
use to create instances and invoke methods on remote EAServer components.
- Register the package.
You are now ready to run the Dynamo application.
For detailed information on setting up an
ActiveX client, see the EAServer Programmer's
Guide.
Setting up PowerDynamo to use EAServer components through Java
To create Java objects to access an EAServer
component:
- Install Jaguar Manager on the Dynamo machine.
- From Jaguar Manager, generate stubs
for the desired package using these options:
- generate Stubs
- Java Stubs
- JDK 1.1
- Ensure that the Java Code Base path
is in your class path.
- Compile the generated Java files
as instructed in the EAServer Programmer's Guide.
- Configure Dynamo for Java support.
See "Configuring Dynamo to use
Java".
- Set your default Jaguar settings.
For information about the default Jaguar settings, see "Changing Dynamo
configuration settings".
Setting up PowerDynamo to use MASP
To set up Dynamo as a client machine to use
MASP method calls you need only to create a connection to the EAServer.
For detailed information on accessing EAServer
MASP methods, see the EAServer Programmer's Guide.
There are two types
of connections that may be created to access EAServer from PowerDynamo.
- Sybase ODBC data source connection
- Open Client connection
ActiveX and Java object calls
If you are creating instances of
either ActiveX or Java objects within a script and no MASP method
calls are involved, a connection to the EAServer as described here
is not required. For ActiveX objects, a connection is made through
the ActiveX proxy server that you install on your machine as explained in "Setting up PowerDynamo
as a client". For Java objects, a connection
is made through the Object Request Broker (ORB). See the EAServer
Programmer's Guide for more information on ORBs.
Using
an ODBC data source to connect to EAServer
To create an ODBC data source connection:
- Register EAServer in the Dynamo
machine's sql.ini file.
- Create an ODBC data source.
- Create a permanent user connection to
EAServer. If you do not require connection pooling you can create
a temporary user connection instead of a permanent user connection.
To register EAServer in the Sybase\sql.ini
file:
- On the machine running EAServer,
open <EAServer>\ini\sql.ini.
- From the EAServer machine, copy <EAServer>\ini\sql.ini file
to the Dynamo machine; for example, Sybase\ini\sql.ini.
The file should look something like this. If
you have configured the EAServer TDS listener to something other
than localhost, replace localhost with this value.
[EAServer]
master=NLWNSCK,localhost,7878
query=NLWNSCK,localhost,7878
http=NLWNSCK,localhost,8080
iiop=NLWNSCK,localhost,9000
To create an ODBC data source for EAServer:
- Start the ODBC Administrator.
- Click Add.
- Select the Sybase System 11 driver and
click Finish.
- On the General tab, enter an ODBC data
source name (for example, EAServer_dsn), and a Server name
(for example, EAServer).
- Click OK to create the data source.
To create a permanent user connection to EAServer:
- Start the EAServer.
- Use Sybase Central to connect to the
Dynamo Web site that contains the scripts requiring a connection
to EAServer.
- Open the Connection folder.
- Click Add Connection.
- Give the connection a name. Click Next.
- Enter a description for the connection.
Click Next.
- Select ODBC as the connection type. Click
Next.
- Select the data source for the connection,
which is the name of the ODBC data source that you created in the
previous procedure. Click Next.
- Enter a user ID for this connection.
The EAServer samples use jagadmin as the user ID. Click Next.
- Enter a password for this connection.
The EAServer samples use a blank password. Click Next.
- Click Finish.
Your permanent user connection should now be
visible from the connection folder in Sybase Central. To use this
connection for scripts that require an EAServer connection, right-click
on the script, select Properties, and choose the new connection.
You can also do this at the folder level. If you set the connection
to at the folder level any scripts within that folder with a connection type
set to <inherited> will use the EAServer connection
as their default connection.
You can also access the EAServer connection
using the DynaScript method site.GetConnection or
the Dynamo SQL tag and attributes.
Using an Open Client connection to connect to EAServer
If an Open Client connection is required, you
must:
- Register EAServer in the sql.ini file.
- Create a permanent user connection
to EAServer.
To register EAServer in the Sybase\sql.ini
file:
- Open the sql.ini file
that resides in <EAServer>\ini\.
- Copy the contents of the sql.ini file
to the sql.ini file on the Dynamo machine.
For example, Sybase\ini\sql.ini.
The content being copied should look something
like the following. If the EAServer TDS listener has been configured
to something other than localhost, for example the machine name,
replace localhost with this value.
[EAServer]
query=NLWNSCK,localhost,7878
To create a permanent user connection to EAServer:
- Start the EAServer.
- Use Sybase Central to connect to the
Dynamo Web site containing the scripts that require a connection
to EAServer.
- Open the Connection folder.
- Click Add Connection.
- Give the connection a name. Click Next.
- Enter a description for the connection.
Click Next.
- Select Open Client as the type of connection
you want to create. Click Next.
- Enter the EAServer name. Click Next.
- Leave the database name blank. Click
Next.
- Enter a user ID for the connection. The
EAServer sample uses jagadmin as a user ID. Click Next.
- Enter a password for this connection.
The EAServer samples use a blank password. Click Finish.
Your permanent user connection should now be
visible from the connection folder. To use this connection for scripts
that require an EAServer connection, right-click on the script,
select Properties and choose the new connection. You can also do
this at the folder level. Any scripts in the folder you select that
have a connection type of <inherited> will use
the EAServer connection as their default connection.
You can also access the EAServer connection
using the DynaScript method site.GetConnection
or
the Dynamo SQL tag and attributes.
Copyright © 2001 Sybase, Inc. All rights reserved.
|
|