The operation
sample consists of two Microsoft Visual C++ ATL App Wizard projects, operation1
and operation2
. The operation1
project simply defines various UDTs and interfaces. The operation2
project defines coclasses that utilize the UDT and interface definitions from operation1
. The operation2
project contains the following three coclasses:
With the corresponding default interfaces from the operation1
project:
You may use the operation sample to provide you with guidance on how to construct parameters of exceptionally complex data types.
The service component is not the only Request Response Service or Subscription Service that can process operation request/documents published by testinterceptor
. Any Request Response Service or Subscription Service can perform this processing for testinterceptor
. Using the service component, however, provides an easy way to verify the operation of the adapter.
This is an MSVC++ Win32 Console Application.
testinterceptor.dsw
project in the examples\TestInterceptor
directory. Set the testinterceptor
project to active.testinterceptor
project, to generate the testinterceptor.exe
executable.
adcomservice -system:repoURL "c:\tibco\adapter\adcom\
5.3\examples\sample.dat" -system:configURL "Adapter for COM/Service Instances/TIBCOCOMService1"
testinterceptor
.exe
. It will perform the following actions:CreateInstanceFromMoniker
to obtain the ITestobj1
, ITestobj2
and ITestobj3
interfaces. These interfaces are actually interceptor
proxies.ITestobj1
, ITestobj2
and ITestobj3
interfaces. These methods will result in TIBCO ActiveEnterprise operation requests or published documents being sent over TIBCO Rendezvous. These operation requests/documents will be received and processed by the service component.
This is an MSVC++ Win32 Console Application.
testinterceptor.dsw
project in the examples\TestInterceptor
directory. Set the testinterceptorCm
project to active.testinterceptorCm
project, causing the executable testinterceptorCm.exe
to be generated.
adcomservice -system:repoURL "c:\tibco\adapter\adcom\
5.3\examples\sampleCm.dat" -system:configURL "Adapter for COM/Service Instances/TIBCOCOMService1"
testinterceptorCm
.exe
. It will perform the following actions:CreateInstanceFromMoniker
to obtain the ITestobj1
, ITestobj2
and ITestobj3
interfaces. These interfaces are actually interceptor
proxies.ITestobj1
, ITestobj2
and ITestobj3
interfaces. These methods will result in TIBCO ActiveEnterprise operation requests or published documents being sent over TIBCO Rendezvous using certified messaging. These operation requests/documents will be received and processed by the service component.
This section explains how to use the testinterceptor
program (that ships with the example code), to test the ADODB RecordSet support provided by the adapter. This example uses the Microsoft SQL Server 2000 for the database support.
A sample server source code written in C++, which interacts with the database, is provided in the examples\Operation\Operation3
directory of the adapter installation.
The example in \Operation\Operation3
contains a OPERATION3
module that defines a class Testobj4
.
The Testobj4
class contains only one method named GetRecordSet
, which implements the functionality provided by the class. The GetRecordSet
method of Testobj4
class takes two arguments and returns a ADODB RecordSet pointer. The first argument is the connection string and the second argument is the SQL query string.
The format of the connection string is similar to the following:
The format of the query string is similar to the following:
The TestInterceptor
application is enhanced to contain a method called TestRecordSet
that invokes TestObj4::GetRecordSet()
when TEST_RECORDSET
is defined in the project. Also, the project file Sample.dat,
available in the examples
directory contains additional metadata for the Operation3::TestObj4
class, and associated endpoint configurations.
To test the ADODB RecordSet support using the testinterceptor program:
TestRecordSet.sql
available in the examples\Operation\Operation3
directory is an SQL script that creates a table and inserts some test records in that table.
Run the Query Analyzer
, open the SQL script, and execute that query.
Also, you can run the query from the command prompt using the isqlw
utility. For more information on isqlw
, see the documentation that ships with Microsoft SQL Server 2000.
Operation\Operation3
project from the examples
directory. Make sure that Operation3.dll
is registered with the system.TestInterceptor
project using Microsoft Visual Studio. Modify the Connectionstring
parameter for the database connection in the TestRecordSet
method. Provide the User ID
, Provider
, Data Source
, and Initial Catalog
values according to your database server settings. By default, the recordset method call is not enabled in the project. Comment out the "#define TEST_RECORDSET"
line to call the TestRecordSet
method.This section explains how the TIBCO ActiveEnterprise client (TIBCO BusinessWorks example) uses the ADO connection object implemented in the COM server.
This example uses Microsoft SQL Server 2000 for the database support.
A sample server source code written in C++, which interacts with the database, is available at the examples\TEAKExamples\ConnectionExample\VCExample\ConnectionServer
directory of the adapter installation.
The COM server exposes an interface ITestConnection
which has the following method:
GetConnection([in] BSTR szConnectString, [in,out] _Connection** pConn);
This method is called by the Client to get the Connection pointer from the server, by passing a valid connection string as the [in]
parameter. The second parameter can be of type [in, out]
, [out, retval]
.
GetData([in] BSTR szQueryString, [in, out] _Connection** pConn, [out, retval] _Recordset** pRecSet);
This method is called by the Client to get a recordset by passing the connection pointer available from the GetConnection
method and providing a proper query string as the [in]
parameter. The second parameter can be of type [in]
or [in,out]
.
ReleaseConnection([in]_Connection* pConn);
This method is called by the Client to release the connection object obtained from the GetConnection
method.
A sample server source code written in Microsoft Visual Basic, which interacts with the database, is available at the examples\TEAKExamples\ConnectionExample\VBExample\ConnectionServer
directory of the adapter installation.
Its interface and method implementations are similar to the C++ COM server, but is written in Microsoft Visual Basic.
Three TIBCO BusinessWorks process scenarios are provided as client examples. The repository file [RepoDir]
is available at examples\TEAKExamples\ConnectionExample\VCExample
. The corresponding dat file [repodata.dat]
is available at examples\TEAKExamples\ConnectionExample\VCExample
.
The project files can be opened in TIBCO Designer.
The three process scenarios are:
Simple Process
describes one connection, and data retrieval using that connection, and finally release of that connection. All the three implemented methods in the Example COM server are used in this TIBCO ActiveEnterprise process example.OneConnectionOnMultipleRecordset
process explains the possible usage of Connection implementation. The client can use the same connection object to get multiple recordsets, that is, data retrieval .MultipleConnection
process explains the scenario of multiple connection objects that can be created, and their data retrieval.GetConnection
method, is given as DSN=AdoDemo;UID=sa;PWD=;
. You must create a valid DSN by clicking Control Panel>Administrative Tools> Data Sources (ODBC), and change the connection string accordingly.
TestRecordSet.sql
available in the examples\Operation\Operation3
directory is an SQL script that creates a table and inserts some test records in that table. Run the SQL Query Analyzer, open the SQL script, and execute that query.
Also, you can run the query from the command prompt using the isqlw
utility. For more information on isqlw
, see the documentation that ships with Microsoft SQL Server 2000.
TEAKExamples\ConnectionExample\VCExample\ConnectionServerproject
. Make sure that ConnectionServer.dll
is registered with the system.
The description and instructions for running this example are similar to the TIBCO ActiveEnterprise Client Example for C++ Server. The example is available at examples\TEAKExamples\ConnectionExample\VBExample
.
Problem: You may get the following error from either the service or interceptor component:
Error encountered (e2000042). MException thrown: Connection to TIB CR failed. Instance name attempted to is c:\tibco\adapter\adcom\5.3\examples\sample.
Solution: You probably installed TIBCO Adapter for COM in a directory other than the default (c:\tibco\adapter\adcom)
. To allow the interceptor
to find the repository, you need to edit the file main
.cpp
in the testinterceptor
project and change all occurrences of the string c:\tibco\adapter\adcom\
5.3\examples\sample.dat
to point to the correct location of the repository file. To allow the service to find the repository, you must provide the correct value for the system:repourl
command line switch.
TIBCO Adapter™ for COM User’s Guide Software Release 5.3, September 2005 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |