Ready to get started?

Configure a One-Way Send Port for the CData BizTalk Adapter for IBM Cloud Object Storage



Use the adapter for IBM Cloud Object Storage with a one-way send port to execute updategrams and data manipulation SQL in BizTalk.

This section provides step-by-step instructions for creating, configuring, and testing a static one-way send port using the CData BizTalk Adapter for IBM Cloud Object Storage. You can use static one-way send ports to execute updategrams, SQL commands, and stored procedures. Send ports are useful for operations that modify IBM Cloud Object Storage data but do not have any response data. Typically, this would be DELETE or UPDATE SQL commands or updategrams, and occasionally stored procedure operations.

If you want to trigger actions that will return a response, such as executing SELECT commands or retrieving the Id of a record that you have created, use a solicit-response send port.

Create and Configure the One-Way Send Port

Create a static one-way send port and configure it to use the IBM Cloud Object Storage adapter as its transport type.

  1. If you have not already done so, open your BizTalk application in the BizTalk Administration Console.
  2. In the node for your BizTalk application, right-click Send Ports and select New -> Static One-Way Send Port. The send port properties dialog is displayed.
  3. In the Name menu, enter a name for the send port.
  4. In the Type menu, select CData.IBMCloudObjectStorage.
  5. In the Send Pipeline menu, select the default option, PassThruTransmit.

Configure the Adapter

Define the command that the adapter will execute in the Transport Properties dialog.

  1. In the send port properties, click the Configure button. The CData.IBM Cloud Object Storage Transport Properties dialog is displayed.
  2. In the CommandType property, select the command type you want.
  3. If you want to execute an SQL command, enter the command in the SQL Command box.
Refer to the "Adapter Configuration" chapter in the help documentation for a description of the various properties and their functions.

Configure the Connection to IBM Cloud Object Storage

Configure credentials and other properties required to connect to IBM Cloud Object Storage in the Connection String Options dialog.

  1. In the send port properties dialog, click Configure. The adapter properties dialog is displayed.
  2. Click the button in the Connection String property.
  3. Click the box in the Connection String property. The Connection String Options dialog is displayed.
  4. Enter connection properties. Below is a typical connection string: ApiKey=myApiKey;CloudObjectStorageCRN=MyInstanceCRN;Region=myRegion;OAuthClientId=MyOAuthClientId;OAuthClientSecret=myOAuthClientSecret;

    Register a New Instance of Cloud Object Storage

    If you do not already have Cloud Object Storage in your IBM Cloud account, follow the procedure below to install an instance of SQL Query in your account:

    1. Log in to your IBM Cloud account.
    2. Navigate to the page, choose a name for your instance and click Create. You will be redirected to the instance of Cloud Object Storage you just created.

    Connecting using OAuth Authentication

    There are certain connection properties you need to set before you can connect. You can obtain these as follows:

    API Key

    To connect with IBM Cloud Object Storage, you need an API Key. You can obtain this as follows:

    1. Log in to your IBM Cloud account.
    2. Navigate to the Platform API Keys page.
    3. On the middle-right corner click "Create an IBM Cloud API Key" to create a new API Key.
    4. In the pop-up window, specify the API Key name and click "Create". Note the API Key as you can never access it again from the dashboard.

    Cloud Object Storage CRN

    If you have multiple accounts, you will need to specify the CloudObjectStorageCRN explicitly. To find the appropriate value, you can:

    • Query the Services view. This will list your IBM Cloud Object Storage instances along with the CRN for each.
    • Locate the CRN directly in IBM Cloud. To do so, navigate to your IBM Cloud Dashboard. In the Resource List, Under Storage, select your Cloud Object Storage resource to get its CRN.

    Connecting to Data

    You can now set the following to connect to data:

    • InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken.
    • ApiKey: Set this to your API key which was noted during setup.
    • CloudObjectStorageCRN (Optional): Set this to the cloud object storage CRN you want to work with. While the connector attempts to retrieve this automatically, specifying this explicitly is recommended if you have more than Cloud Object Storage account.

    When you connect, the connector completes the OAuth process.

    1. Extracts the access token and authenticates requests.
    2. Saves OAuth values in OAuthSettingsLocation to be persisted across connections.

  5. Click Test Connection to verify the values and test connectivity.
Refer to the "Connection String Options" chapter in the help documentation for a description of the various properties and their functions.

After you connect successfully and define the command the adapter will execute, the send port is ready for use. See the following section for an example of using a one-way send port in a simple application. The application reads updategram commands contained in a file and uses a send port to execute the command.

In the example, filters are used to move the messages that contain the updategram from the receive location to the send port. See the following section for more information on filters.

Create Filters to Route BizTalk Messages Through an Application

To associate a send port with the messages you want, create a filter rule in the Filters section of the properties for that send port. Messages matching the criteria will be routed to the send port. See the following example to filter on a receive location.

Example: Execute Updategrams with a One-Way Send Port

This section shows how to use a one-way send port in a simple application. The application reads updategram commands contained in a file and executes the commands:

  1. A one-way receive location picks up the XML document containing the updategram.
  2. The receive location creates a BizTalk message containing the results of the command.
  3. A one-way send port filters on the URI of the receive location. The document is routed to the one-way send port.
  4. The send port executes the updategram command.

As in the preceding example, the followings steps show how to set up a receive location to read updategrams from a file and use a send port to execute the commands:

  1. Create and configure a static one-way receive location. Use the File transport type. You can follow the same procedure to create and configure a receive location for the CData BizTalk Adapter for IBM Cloud Object Storage.
  2. Create a static one-way send port.
  3. In the send port properties, click Filters.
  4. In an empty property, set the following values:
    Property
    Select BTS.InboundTransportLocation from the menu.
    Value
    Enter the URI of the newly created one-way receive location.