Tuxedo
0

Using the Tuxedo TOP END Domain Gateway with ATMI Applications

 Previous Next Contents View as PDF  

Request/Response Mode Programming

This topic includes the following sections:

 


Using Request/Response Messaging with the TEDG

The TEDG supports the exchange of messages in request/response mode between BEA Tuxedo and BEA TOP END systems. Messages are passed between the two systems using the TEDG as an intermediary.

See Also

 


How Messages Are Passed from BEA Tuxedo Clients to BEA TOP END Servers

BEA Tuxedo clients communicate with BEA TOP END services through the TEDG. Relative to a BEA Tuxedo client, the TEDG functions as a local server. The TEDG advertises services specified in the SERVICE entries in the DM_REMOTE_SERVICES section of the DMCONFIG file. Client programs make requests and receive responses using tpcall(3c) in the same way they use tpcall() to interact with local services. Asynchronous requests and responses are supported through the tpacall(3c) and tpgetrply(3c) functions. If, in the DM_REMOTE_SERVICES section of the DMCONFIG file, the SERVICE entry for a TEDG service contains the setting CONV=N, then BEA Tuxedo clients may communicate with that service in only one mode: request/response. (CONV=N is the default value and does not need to be set.)

The TEDG uses the requested service name to locate the SERVICE entry in the DM_REMOTE_SERVICES section to determine the corresponding BEA TOP END product, function, Message Sensitive Routing (MSR) target, and function qualifier for the mapped BEA TOP END request. Data marshalling is performed by the TEDG, as required, before the message is sent to the BEA TOP END system. The BEA TOP END system then routes the request to a server on a BEA TOP END node that has received the message. The BEA TOP END server response is unmarshalled, if necessary. The TEDG maps the status of the request and prepares the buffer for delivering the response to the BEA Tuxedo client.

How the TEDG Works with BEA Tuxedo Clients

Client operations are programmed with the same functions used for any BEA Tuxedo client.

Use this function . . .

For . . .

tpcall()

Synchronous requests and responses

tpacall()

Asynchronous requests and responses

tpgetreply()

Asynchronous requests and responses


 

These functions are programmed in the normal manner.

As a BEA Tuxedo client programmer, you need to know the following information:

Because BEA TOP END messages are limited to 30K bytes, the size of the client request may not exceed that limit. For an FML32 message, the limit applies after the FML index is stripped from the message.

How the TEDG Maps Client Requests

A client request may be transactional or non-transactional and it may or may not require a response. The following table shows how BEA Tuxedo client flags are mapped to a BEA TOP END request. All other flags (TPNOCHANGE, TPNOBLOCK, TPNOTIME, TPSIGRSTRT) and the service priority (see tpsprio()) either are local to the application or affect only client-TEDG interactions in the BEA Tuxedo system. By processing the following flags, the TEDG accomplishes tasks that are normally done in the BEA Tuxedo system.

Table 12-1 BEA Tuxedo Client Flag Mapping

BEA Tuxedo Client Flag

Action

TPNOTRAN

The TEDG preserves the fact that the request is excluded from the client transaction by the ATMI library.

TPNOREPLY

Passed as TP_NO_RESPONSE to the BEA TOP END system. The BEA TOP END routing status is not passed to the BEA Tuxedo client.


 

The tperrno values returned to the BEA Tuxedo client are standard values. Because the TEDG acts as a BEA Tuxedo server, it also returns TPESVCERR and TPESVCFAIL for certain conditions. The BEA Tuxedo client cannot interpret these messages as "application defined errors" exclusively:

For additional information, see Error Values.

Note: tpurcode is not supported by the TEDG.

The TEDG maps the response from the BEA TOP END system/server to a response that the BEA Tuxedo client accesses through the tpcall parameters or the tpgetrply function. A BEA TOP END server may deliver a response in either a raw buffer or an FML32 buffer. A raw buffer is normally mapped by the TEDG to a CARRAY buffer unless the administrator configures it to map to an X_OCTET buffer. Additionally, the administrator may constrain the response buffer to one of the following types: CARRAY, X_OCTET or FML32. If the BEA TOP END service returns an incompatible buffer, the TEDG returns a tperrno of TPEOTYPE.

How the TEDG Works with BEA TOP END Servers

Relative to a BEA TOP END server, the TEDG functions as a BEA TOP END client: it receives mapped BEA Tuxedo client requests in the normal manner through tp_server_receive(3T). The buffer received is either a raw buffer or an FML32 buffer, depending on the message sent by the BEA Tuxedo client. The BEA TOP END server receives one of the following types of requests:

The BEA TOP END server handles both types of requests according to standard BEA TOP END programming requirements. The client request may be transactional or non-transactional.

How the TEDG Maps BEA TOP END Server Send Flags

The BEA TOP END server responds to a client request using tp_server_send(3T). The response buffer may be either a raw buffer or an FML32 buffer, depending on what is supported by the BEA TOP END application, the TEDG configuration, and the BEA Tuxedo client. This buffer is mapped to a BEA Tuxedo client buffer as described in How the TEDG Maps Client Requests.

The following table shows how BEA TOP END tp_server_send(3T) flags are mapped. The server may indicate an error by resetting the dialog or by responding with an application-defined field value in the response buffer. The BEA Tuxedo client must be programmed to respond appropriately. Do not use the output_format and attach_info parameters on responses to the TEDG; they are not supported.

Table 12-2 BEA TOP END "Server Send" Flags  

BEA TOP END Server Flag

Action

TP_RESET_DIALOG

TPESVCFAIL is returned to the BEA Tuxedo client.

TP_ROLLBACK_ONLY

The TEDG marks the state of the transaction associated with the request as "abort-only."

TP_DISSOLVE

A response is passed to the BEA Tuxedo client. Because the TEDG manages dialogs in a special manner, the results of setting the flag are the same as the results of not setting the flag.

TP_APPL_CONTEXT

Indicates that the server wants to initiate a conversation. This request for conversational mode is an error for request/response processing. TESVCERR is returned to the BEA Tuxedo client. The BEA TOP END server is disconnected (TP_DISCONNECT) by the TEDG.

TP_FML_BUF

The TEDG passes the user data as an FML32 buffer.


 

Error Values

The following error values may be returned to a BEA Tuxedo client because problems exist in the TEDG, the BEA TOP END system, or the BEA TOP END server. Keep in mind that a single tperrno value may be used to report any one of many possible causes of the error being reported.

Because the TEDG does not advertise services based upon the actual availability of BEA TOP END services, a message may be routed to a BEA TOP END node where the services actually are unavailable, resulting in a tperrno of TPENOENT, while other routing decisions may result in successful requests. If a service is to be available on multiple nodes, the design of the BEA Tuxedo application, the BEA TOP END application, and the TEDG must take into account the possibility that this type of failure may occur. A well-designed application, that ensures that there are multiple, restartable copies of the servers, reduces the possibility of such errors occurring.

Table 12-3 Error Values Returned to a BEA Tuxedo Client  

BEA Tuxedo tperrno Value

Cause

TPENOENT

No match was found on the SERVICE entry.

TPENOENT

A tpcall or tpacall request was sent to a conversational service (CONV=Y).

TPENOENT

TP_SERVICE was returned by the BEA TOP END system.

TPESVCERR with an error detail of TPED_DOMAINUNREACHABLE

An on-demand connection failed.

TPESVCERR

The input buffer type does not match the one specified in the INBUFTYPE field of the SERVICE entry or it is not a type that is supported by the TEDG. (FML32, CARRAY, and X_OCTET are supported.)

TPESVCERR

The input buffer exceeds the maximum message size of 30K bytes (after the FML index is stripped for FML buffers).

TPESVCERR

The server returned TP_APPL_CONTEXT on a non-conversational SERVICE entry.

TPESVCFAIL

TP_RESET was returned by the BEA TOP END system.

TPEOTYPE

The buffer type of the server response does not match the type specified in the OUTBUFTYPE field of the SERVICE entry.

TPESYSTEM

Error due to public/private key encryption:

The client input was rejected because the BEA Tuxedo system is configured to require encryption and the TEDG could not decrypt the message before sending it to the BEA TOP END system.

TPESYSTEM

Error due to digital signature:

The client input was rejected because the BEA Tuxedo system is configured to require digital signatures and the TEDG could not remove the digital signature from the message before sending the message to the BEA TOP END system.


 

See Also

 


How Messages Are Passed from BEA TOP END Clients to BEA Tuxedo Servers

BEA TOP END clients communicate with BEA Tuxedo servers through the TEDG. If, in the DM_LOCAL_SERVICES section of the DMCONFIG file, the SERVICE entry for a TEDG service contains the setting CONV=N, then BEA TOP END clients may communicate with that service in only one mode: request/response. (CONV=N is the default value and does not need to be set.)

Relative to a BEA TOP END client, the TEDG functions as a BEA TOP END server on a remote BEA TOP END node. The TEDG receives a BEA TOP END client request and maps it to a corresponding BEA Tuxedo request. Note that the BEA Tuxedo system may route the request to a BEA Tuxedo server anywhere within the BEA Tuxedo configuration.

The process for passing messages in request/response mode from a BEA TOP END client to a BEA Tuxedo server is as follows:

How the TEDG Works with BEA TOP END Clients

Client operations are programmed with the same functions used for any BEA TOP END client.

Use This API . . .

For . . .

tp_client_send

Making asynchronous requests

tp_client_signon

Making asynchronous requests

tp_client_receive

Receiving responses


 

These functions are used in the normal manner when making a service request to a BEA Tuxedo server through the TEDG.

As a BEA TOP END client programmer, you need to know the following information:

How the TEDG Maps Client Requests

A client request may be transactional or non-transactional and it may or may not require a response. The following table shows how BEA TOP END client flags are mapped. By processing these flags, the TEDG accomplishes tasks that are normally done in the BEA TOP END system. Do not use the input_format and attach_info parameters on requests to the TEDG; they are not supported.

Table 12-4 BEA TOP END Client Flag Mapping  

BEA TOP END Client Flag

Action

TP_DISSOLVE

The dialog is dissolved after the TEDG returns the BEA Tuxedo server response.

TP_NON_TRANSACT

The TEDG preserves the fact that the request is excluded from the client transaction by the CSI library.

TP_NO_RESPONSE

Mapped to TPNOREPLY by the TEDG. Like the BEA TOP END system, the TEDG responds to the BEA TOP END client with a routing status.

TP_FML_BUF

The TEDG passes the user data as an FML32 buffer.


 

The status and extended status values returned to the BEA TOP END client are standard values. Additional information on the mapping of error values is provided later in this topic.

The TEDG maps the response from the BEA Tuxedo system/server to a response that the BEA TOP END client accesses through the tp_client_receive(3T) call. A BEA Tuxedo server may deliver a response in a CARRAY, X_OCTET, or FML32 buffer. A CARRAY or X_OCTET buffer is mapped by the TEDG to a raw message; an FML32 buffer, to a BEA TOP END FML32 message. Additionally, the administrator may constrain the response buffer to one of the following types: CARRAY, X_OCTET, or FML32. If the BEA Tuxedo service returns an incompatible buffer, the TEDG returns a TP_RESET status.

How the TEDG Works with BEA Tuxedo Servers

Relative to a BEA Tuxedo server, the TEDG functions as a BEA Tuxedo client: it receives mapped BEA TOP END client requests in the normal manner. The type of the buffer it receives (CARRAY, X_OCTET, or FML32) depends on the message sent by the client. The BEA Tuxedo server processes the request in the normal manner. The request may be transactional or non-transactional. It may be a "no-reply" request.

A BEA Tuxedo server responds to a client request using tpreturn(3c). TPSUCCESS is mapped to a TP_OK BEA TOP END status. TPFAIL and TPEXIT, along with a number of other error conditions, are mapped to a TP_RESET BEA TOP END status. A reply message is supported only with TPSUCCESS.

Note: The application-defined return code, rcode, is not supported by the TEDG.

The BEA Tuxedo server may deliver a reply in a CARRAY, X_OCTET, or FML32 buffer, depending on which buffer types are supported by the BEA TOP END system, the TEDG configuration, and the BEA TOP END client. The reply buffer is mapped to a BEA TOP END message. The server may indicate an error by sending a TPFAIL error or by responding with an application-defined field value in the reply buffer. The BEA TOP END client must be programmed to handle that error reporting interface of the server.

Because BEA TOP END messages are limited to 30K bytes, the BEA Tuxedo server reply may not exceed that limit. For an FML32 message, the limit applies after the FML index is stripped from the message.

Error Values

In addition to regular BEA TOP END error status messages, a number of other status messages may be returned to a BEA TOP END client as a result of problems in the TEDG, the BEA Tuxedo system, or the BEA Tuxedo server. Keep in mind that a single error status value may be used to report any one of many possible causes of the error being reported.

Because the TEDG does not advertise services based upon the actual availability of BEA Tuxedo services, a message may be routed to a BEA Tuxedo node where the services actually are unavailable, resulting in a TP_SERVICE error, while other routing decisions may result in successful requests. If a service is to be available on multiple nodes, the design of the BEA Tuxedo application, the BEA TOP END application, and the TEDG must take into account the possibility that this type of failure may occur. A well-designed application, that ensures that there are multiple, restartable copies of the servers, reduces the possibility of such errors occurring.

Table 12-5 Error Values Returned to a BEA TOP END Client  

BEA TOP END Error Status

Cause

TP_SERVICE, TP_EXT_MSR_FAILURE

The TEDG SERVICE entry lookup failed: the target was not found.

TP_SERVICE, TP_EXT_NO_SUCH_SERV

The TEDG SERVICE entry lookup failed: the product or function was not found (ignoring entries for which RDOM does not have access).

TP_SERVICE, TP_EXT_NO_SUCH_SERV

TPENOENT was returned by the BEA Tuxedo system.

TP_RESET, TP_EXT_SERVER_APPL

The input buffer type does not match the type specified in the INBUFTYPE field of the SERVICE entry.

TP_RESET, TP_EXT_SERVER_APPL

The server response buffer type does not match the type specified in the OUTBUFTYPE field of the SERVICE entry or it is not a type supported by the TEDG. (The supported types are FML32, CARRAY, and X_OCTET.)

TP_RESET, TP_EXT_SERVER_APPL

The server response buffer exceeds the maximum message size of 30K bytes (after the FML index is stripped for FML buffers).

TP_RESET, TP_EXT_SERVER_APPL

TPESVCERR, TPESVCFAIL, and all other tperrno values.

TP_RESET, TP_EXT_SERVER_APPL

Error due to public/private key encryption:

The client input was rejected by the BEA Tuxedo server because the BEA Tuxedo system is configured to require encryption and the TEDG could not decrypt the message before sending it to the BEA TOP END system.

TP_RESET, TP_EXT_SERVER_APPL

Error due to digital signature:

The client input was rejected by the BEA Tuxedo server because the BEA Tuxedo system is configured to require digital signatures and the TEDG could not remove the digital signature from the message before sending the message to the BEA TOP END system.


 

See Also

 

Back to Top Previous Next
Contact e-docsContact BEAwebmasterprivacy