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:

Note  

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:

  1. Install Jaguar Manager on the Dynamo machine.
  2. Install the ActiveX Proxy Automation Server using the client installation program on the Dynamo machine.
  3. From Jaguar Manager, connect to the EAServer that contains the required components.
  4. 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.
  5. 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:

  1. Install Jaguar Manager on the Dynamo machine.
  2. From Jaguar Manager, generate stubs for the desired package using these options:

  3. Ensure that the Java Code Base path is in your class path.
  4. Compile the generated Java files as instructed in the EAServer Programmer's Guide.
  5. Configure Dynamo for Java support. See "Configuring Dynamo to use Java".
  6. 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.

Note  

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

Steps To create an ODBC data source connection:

  1. Register EAServer in the Dynamo machine's sql.ini file.
  2. Create an ODBC data source.
  3. 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.

Steps To register EAServer in the Sybase\sql.ini file:

  1. On the machine running EAServer, open <EAServer>\ini\sql.ini.
  2. 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

Steps To create an ODBC data source for EAServer:

  1. Start the ODBC Administrator.
  2. Click Add.
  3. Select the Sybase System 11 driver and click Finish.
  4. On the General tab, enter an ODBC data source name (for example, EAServer_dsn), and a Server name (for example, EAServer).
  5. Click OK to create the data source.

Steps To create a permanent user connection to EAServer:

  1. Start the EAServer.
  2. Use Sybase Central to connect to the Dynamo Web site that contains the scripts requiring a connection to EAServer.
  3. Open the Connection folder.
  4. Click Add Connection.
  5. Give the connection a name. Click Next.
  6. Enter a description for the connection. Click Next.
  7. Select ODBC as the connection type. Click Next.
  8. 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.
  9. Enter a user ID for this connection. The EAServer samples use jagadmin as the user ID. Click Next.
  10. Enter a password for this connection. The EAServer samples use a blank password. Click Next.
  11. 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:

  1. Register EAServer in the sql.ini file.
  2. Create a permanent user connection to EAServer.

Steps To register EAServer in the Sybase\sql.ini file:

  1. Open the sql.ini file that resides in <EAServer>\ini\.
  2. 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

Steps To create a permanent user connection to EAServer:

  1. Start the EAServer.
  2. Use Sybase Central to connect to the Dynamo Web site containing the scripts that require a connection to EAServer.
  3. Open the Connection folder.
  4. Click Add Connection.
  5. Give the connection a name. Click Next.
  6. Enter a description for the connection. Click Next.
  7. Select Open Client as the type of connection you want to create. Click Next.
  8. Enter the EAServer name. Click Next.
  9. Leave the database name blank. Click Next.
  10. Enter a user ID for the connection. The EAServer sample uses jagadmin as a user ID. Click Next.
  11. 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.