Copyright © TIBCO Software Inc. All Rights Reserved

> tibemsXAConnection_Create
> Function
> Purpose
> Create a new XA connection to an EMS server; use XA for transactions.
> C Declarations
> tibems_status tibemsXAConnection_Create(
> tibemsConnection* connection,
> const char* brokerURL,
> const char* clientId,
> const char* username,
> const char* password );
> tibems_status tibemsXAConnection_CreateSSL(
> tibemsConnection* connection,
> const char* brokerURL,
> const char* clientId,
> const char* username,
> const char* password,
> tibemsSSLParams sslParams,
> const char* pk_password );
> COBOL Call
> CALL "tibemsXAConnection_Create"
> USING BY REFERENCE connection,
> BY REFERENCE brokerURL,
> BY REFERENCE clientId,
> BY REFERENCE username,
> BY REFERENCE password,
> RETURNING tibems-status
> END-CALL.
> CALL "tibemsXAConnection_CreateSSL"
> USING BY REFERENCE connection,
> BY REFERENCE brokerURL,
> BY REFERENCE clientId,
> BY REFERENCE username,
> BY REFERENCE password,
> BY VALUE sslParams,
> BY REFERENCE pk-password,
> RETURNING tibems-status
> END-CALL.

> | connection and sslParams have usage pointer.

> Parameters

> Parameter | Description
> connection | The function stores the new connection in this location.
> brokerURL | Find the EMS server at this URL. If configuring a fault-tolerant client, enter two of more URLs, as described in Configuring C and COBOL Clients for Fault-Tolerant Connections.
> clientId | Identify the client program to the server with this unique ID.
> username | Identify the client program to the server with this user name.
> password | Authenticate the client program to the server with this password.
> sslParams | Establish SSL communication using these parameters.
> pk_password | Private key password for SSL.

> Status Code | Description
> TIBEMS_OK | The call succeeded.
> TIBEMS_SERVER_NOT_CONNECTED |
> • | No server is running at the specified URL.
> • | The call could not communicate with a server because of mismatched SSL and TCP protocols.
> • | Other error situations are possible.
> TIBEMS_SECURITY_EXCEPTION |
> • | The server rejected the connection because the username or password was invalid.
> • | SSL setup is incorrect.
> TIBEMS_INVALID_CLIENT_ID | The client ID is not unique; that is, another client already uses the ID.

> See Also
> tibemsConnection_Create on page 206

Copyright © TIBCO Software Inc. All Rights Reserved