Attachmate Worldwide  |   Contact Us  |   NetIQ.com
Home » Support » Solution Library

Technical Notes

Sending E-mail Using TransferData Demo Component
Technical Note 10224
Last Reviewed 30-Sep-2004
Applies To
Verastream Integration Broker version 9.5 or higher
Summary

This technical note explains how to use a Verastream demonstration component TransferData to send e-mail from a Verastream Scripting Language (VSL) application built with Process Integrator (PI). This document also addresses related common problems with the repository component definition and registration.

TransferData Overview

The TransferData component, provided in the Verastream Demonstration Repository, provides sample methods to send or receive data using HTTP, HTTPS (secure HTTP), FTP, SMTP, and POP3. These sample methods call underlying SERVICE, TABLE, and COMPONENT objects built into the Verastream interface.

The following files are located in the <Verastream>\demo\components directory:

  • trdata.fle - file which gets run by the nova executable (binary)
  • trdata.lgc - VSL logic file (ASCII text)
  • trdataco.lgc - component definition (ASCII text)
  • trdata.snp - project file used by Component Developer (ASCII text)

The following procedure guides you through the steps to successfully use this server component.

Step 1—Insert the Repository Component in your Application

Follow the steps below to insert the repository component into your application.

  1. Open Verastream Process Integrator.
  2. Click Insert > Component from Repository.
  3. Select the Verastream Demo Repository.
  4. Select the All Components or Miscellaneous category.
  5. Select the TransferData component.
  6. Click Use.

Step 2—Update the Component Definition

The repository component definition does not reflect updates to the shipping component. Follow the steps below to update the component definitions.

  1. Right-click in the scripting pane (top-right) and click Edit Source.
  2. Click View > EntireModule.
  3. Add a file string argument to the smtp_send method:
      METHOD smtp_send
          ARGUMENTS
          {
          server      FIELD FORMAT=string BUFNAME=server
          data        FIELD FORMAT=string BUFNAME=data
          from        FIELD FORMAT=string BUFNAME=from
          to          FIELD FORMAT=string BUFNAME=to
          cc          FIELD FORMAT=string BUFNAME=cc
          subject     FIELD FORMAT=string BUFNAME=subject
            file        FIELD FORMAT=string BUFNAME=file
          }

Step 3—Add Component Method to your Application

Follow these steps to add the component method to your application.

  1. In the main window, drag "smtp_send" from the Components tab to your START.START script.
  2. Set the string values for all seven fields as shown in the following table:
    Field
    String value
    Required or
    optional

    server
    Host name or IP address of your SMTP email server
    Required
    data
    Email message body (sent as attachment in this implementation)
     
    from
    Email address of sender
    Required
    to
    Email address of recipient
    Required
    cc
    Email address of carbon copy recipient
    Optional
    subject
    Email message subject line
    Optional
    file
    file name to use for the message text. default is 'att1'
    Optional

Step 4—Verify the Component Registration

Before proceeding, follow the steps below to verify that the component has been properly registered.

  1. Open the Component Directory (version 9.5) or Component Directory Explorer (version 9.6) administrative tool. (To start the tool from the command line, use the command nova vsccc. This reads information from the pardir/snregtab.dat files.)
  2. You should see a registered component with the TransferData address listed.

Step 5—Specify the Component Namespace

The Verastream Control Protocol (VCP) client and server need to use a matching namespace/address combination. By default, the TransferData component is registered to run in the local "/.Demo" namespace, but your application will run in the "" namespace. To get these to match, there are a number of approaches:

The VCP client and server must use a matching namespace/address combination. By default, the TransferData component is registered to run in the local "/.Demo" namespace and your application is run in the "" namespace. There are several approaches you can take to coordinate the namespace/address combinations.

Specify a different VCP_NAMESPACE when registering the server (in the Registration Options dialog or using +<variable>=<value> syntax on the command line).

-or-

Specify a different VCP_NAMESPACE when running the application (such as setting environment variable in sn.ini, or clicking Run > Namespace in the Process Integrator).

-or-

In the VSL editor, simply modify the ADDRESS in the component definition to match the registration:

COMPONENT TransferData INTERFACE=VCP ADDRESS=/.Demo/TransferData \
           EXCEPTION=TransferData_DefaultException

Note: Components using a namespace with a "/." prefix are only available locally and are not visible to other Verastream systems (reached over network broadcasts or specified in SNDAEMONPEERS).

Step 6—Run your Application

In PI, click Run > Run Composite Application (or run your saved .pia file using Windows Explorer or the snpi command line). As with any application, it is strongly recommended that you enable debug logging. Debug logging can be enabled by clicking Run > Enable logfile in PI, or by using the MYDBG environment variable.

Troubleshooting Common Problems

Use the information below to troubleshoot common problems with repository component definitions and registration.

Field Does Not Exist

This situation is indicated by a debug log line similar to the following:

ALERT: Field 'smtphost' does not exist >>

Verify that all literal string values are enclosed in quote characters.

Cannot Connect to Server Component

This situation is indicated by debug log lines similar to the following:

surpris - VCP Exception COMM_FAILURE minor=0, 1:COMPLETED_NO
surpris - COMPONENT 'TransferData' METHOD 'smtp_send': Cannot connect to server.
ALERT: COMPONENT 'TransferData' METHOD 'smtp_send': Cannot connect to server. >>
ALERT: Activation server: Request for address 'TransferData' failed: Unknown address >>

This error refers to the Verastream VCP server component, not the SMTP e-mail server. The server component many not be registered (see Step 4—Verify the Component Registration) or may be running at a different VCP namespace/address (see Step 5—Specify the Component Namespace).

Error Converting Network Buffer

This situation is indicated by the following error:

Error converting network buffer to COMPONENT_DATA file.

Add the "file" argument. For details, see Step 2—Update the Component Definition.

Related Technical Notes
10202 Verastream Scripting Language SMTP E-Mail Example

Did this technical note answer your question?

Yes    No    Somewhat     Not sure yet

Additional comments about this tech note:

Need further help? For technical support, please contact Support.