Sun ONE logo     Previous      Contents      Index      Next     

Sun logo
IS B2B: ECXpert 3.6.3 Support for Custom Java Communications Agents 

ECXpert Support for Custom Java Communications Agents

Sun™ Open Net Environment (Sun ONE) Integration Server, B2B Edition (ECXpert) includes support for custom Java™ Communications Agents. This document explains how to create Java Communications Agents with ECXpert to exchange messages. ECXpert provides two sample plug-in Java SMTP Communications Agents you can modify to meet your messaging needs. These sample Java Communications Agents are not production-ready Communications Agents. They are provided to you as a reference for writing your own custom Java Communications Agents.

This document contains the following sections:


ECXpert and Its Communications Agents

Trading partner applications send data files via ECXpert using their native messaging protocols, for example, FTP, HTTP, JMS, ebXML, SMTP, or AS2. ECXpert itself does not interpret all the different protocols. It uses inbound and outbound Communications Agent components as interpreters as illustrated in Figure 1.

On the inbound side, the appropriate Communications Agent accepts the message, extracts the data within it, and submits the data to ECXpert for processing. After processing the submitted data, ECXpert passes the data and messaging parameters to the outbound Communications Agent. The outbound Communications Agent constructs a message in the protocol appropriate for the receiving application using the messaging parameters, and then transmits the message according to the rules of that particular protocol.

Figure 1  ECXpert’s Messaging System

Block diagram of ECXpert's messaging system.


About Custom Java Communications Agents

As with all of the ECXpert Communications Agents, the Java Communications Agent feature provides two agents: an outbound, or send, Communications Agent and an inbound, or receive, Communications Agent. The rest of this section describes these Communications Agents.

Use the send Communications Agent to send outbound messages to your partners. A receive Communications Agent acts as a listener for a messaging server or client you specify.

The alternative to using Java Communications Agents is writing custom Communications Services. Communications Services run separate scripts for each send and receive process. Writing and deploying Communications Services require that a separate process be created each time a script is run.

In instances where large amounts of data are exchanged, multiple JVM processes can create serious performance issues. The benefit to using Java Communications Agents is that each send and receive Communications Agent allows ECXpert to run a dedicated JVM process for loading Java classes.

Java Send Communications Agents

When you create a Java send Communications Agent, you must create or modify trading information in ECXpert for the trading partnership that will use this Communications Agent. You can then start the Communications Agent with the ECXpert Administration interface.

When you start a Java send Communications Agent, you start a dedicated process that runs in the background. When a processed document is ready for sending, the ECXpert gateway process sends a request packet to this process. The entire request packet is passed to the instance of the Communications Agent, which then creates a new thread.

Java Receive Communications Agents

When you create a Java receive Communications Agent, you must create or modify trading information in ECXpert for the trading partnership that will use this Communications Agent. You then start the Communications Agent with the ECXpert Administration interface.

When you start the receive Communications Agent from the ECXpert Administration interface, you start a dedicated process. This process runs in the background, polling for received messages (or some other task your implementation of the receive Communications Agent is designed to execute), until you shut down the Communications Agent from the Administration interface.

Since it is possible that threads might still be processing when you shut down the Communications Agent, it is up to you to implement the shutdown() method in the receive Communications Agent in such a way that all currently executing threads shutdown gracefully.

Custom Java Communications Agent Example

The ECXpert installation includes a plug-in example of Java send and receive Communications Agents. You can find the plug-in example in the following location:

ECXPERT_HOME/NS-apps/ECXpert/javacomm/example

ECXPERT_HOME is the location where you installed ECXpert

To run the plug-in example, you must configure the example based on your ECXpert environment, and then start the Communications Agents. For more information, see the following:


Creating Java Communications Agents

Read these sections first for high-level overviews of the steps required to create and start Java Communications Agents:

After reading the overviews, read the following sections:

Creating Java Send Communications Agents

    To Create a Java send Communications Agent
  1. Implement the following interfaces for the send Communications Agent using the Java framework provided with ECXpert:
  2. Configure a Java send Communications Agent and define its parameters in the ECXpert configuration file (ecx.ini).
    1. Add a section in the ecx.ini file for the send Communications Agent and define the send parameter types for the agent.
    2. You later define these parameters in the Outgoing Protocol screen for a Partnership that will use this Communications Agent.

    3. Set the value of the comm_agent_factory_class parameter of your send Communications Agent in the ecx.ini file.
    4. This value is the fully qualified name of the class that implements the B2BOutboundCommAgentFactory interface in Step 1 above.

      For an example of a send Communications Agent, open the ecx.ini file and search for the section named [user-defined-3]. You can modify the send parameter types in this plug-in example for your own Communications Agent.

      For more information, see Configuring Custom Java Communications Agents.

  3. From the ECXpert Support interface, specify Partnership, Service, and Membership information for the send Communications Agent.
  4. For more information on how to specify this information for a send Communications Agent, see Setting Up and Running the Send Example, or refer to the ECXpert Administrator’s Guide.

  5. From the ECXpert Administration interface, start the send Communications Agent.
  6. For more information, see Starting and Stopping Java Communications Agents.

Creating Java Receive Communications Agents

    To Create a Java receive Communications Agent
  1. Implement the following interfaces for the receive Communications Agent using the Java framework provided with ECXpert:
  2. Configure a Java receive Communications Agent and define its parameters in the ECXpert configuration file (ecx.ini).
    1. Add a section in the ecx.ini for the receive Communications Agent and define the agent’s receive parameters.
    2. Set the value of the comm_agent_factory_class parameter of your receive Communications Agent in the ecx.ini file.
    3. This value is the fully qualified name of the class that implements the B2BInboundCommAgentFactory interface in of Step 1 above.

      For an example of a receive Communications Agent, open the ecx.ini file and search for the section named [commjava-receive]. You can modify the receive parameters in this plug-in example for your own Communications Agent.

      For more information, see Configuring Custom Java Communications Agents.

  3. From the ECXpert Support interface, specify Partnership, Service, and Membership information for the receive Communications Agent.
  4. For more information on how to specify this information for a receive Communications Agent, see Setting Up and Running the Send Example, or refer to the ECXpert Administrator’s Guide.

  5. Start the receive Communications Agent from the ECXpert Administration interface.
  6. For more information, see Starting and Stopping Java Communications Agents.


Implementing the Custom Java Framework

Send Communications Agents

To create a send Communications Agent, you must implement the following interfaces using the provided Java framework:

You create the B2BOutboundCommAgentFactory factory, which initializes your implementation of the B2BOutboundCommAgent.

Locate the documentation for the Java framework, which describes these interfaces, here:
ECXPERT_HOME/NS-apps/ECXpert/javacomm/docs.

ECXPERT_HOME is the location of your ECXpert installation.


Note

The custom Java framework for send Communications Agents supports immediate/scheduled delivery similar to custom Communications Services.


Example Send Implementation

In the case of the example send Communications Agent included with ECXpert, the B2BoutboundCommAgentFactoryImpl class initializes and returns a B2BoutboundMailCommAgent interface in the implementation of the createOutboundCommAgent() method.

Code Example 1 shows the B2BOutboundMailCommAgent class. This class has send and readRequestData as its methods.

Method

Description

readRequestData

This method reads the parameters defined in the Outgoing Protocol screen.

If an Outgoing Protocol parameter is empty, the method throws an exception.

send

This method creates an E-mail message and sends that message to the specified receiver.

If E-mail cannot be sent, the method outputs information to the ECXpert log file.

Code Example 1  B2BOutboundMailCommAgent Class 

package com.sun.iis.b2b.bdg.example;

import com.sun.iis.b2b.core.comm.SendException;

import com.sun.iis.b2b.core.comm.B2BMessageContext;

import com.sun.iis.b2b.core.comm.B2BOutboundCommAgent;

import com.sun.iis.b2b.core.comm.InitializationException;

import com.sun.iis.b2b.core.util.B2BRequestPacket;

import com.sun.iis.b2b.core.util.B2BLogger;

import com.sun.iis.b2b.core.util.B2BFile;

/**

* This is the class for a B2B java communication agent

*

* This is a simple CommAgent which will send out a mail

* everytime when its asked to send out the processed data

*

*/

public class B2BOutboundMailCommAgent

          implements B2BOutboundCommAgent{

     private String mySMTPMailHost = null;

     private int mySMTPMailHostPort = -1;

     private String mySenderEmail = null;

     private String myReceiverEmail = null;

     private String myReceiver = null;

     private String mySender = null;

     private String myUserId = null;

     private String myUserPwd = null;

     private static final long SUCCESS_MSG = 20000;

     private static final long SOME_ERR = 234;

/**

      * This method is called by the CommAgentManager

      * on the Outbound Communication Agent when a request

      * is made to send a processed file.

      *

      * @param aMessageContext is the MessageContext for the

      * message being sent.

      * @throws SendException if there is a problem

      * in processing the send request.

      */

   public void send(B2BMessageContext aMessageContext) throws SendException{

      B2BRequestPacket dataPkt = null;

      long trkId = 0;

      try {

         dataPkt = aMessageContext.getB2BRequestPacket();

         trkId = dataPkt.getTrackingId();

         readRequestData(dataPkt);

         SendMail smtpMailSender = new SendMail(myMailHost,
                                         mySMTPMailHostPort);

         java.util.Vector fileList = dataPkt.getFileList();

         int numFiles = fileList.size();

         String[] emailList = { myReceiverEmail };

         for ( int i=0; i < numFiles; i++ ){

              B2BFile oneFile = (B2BFile) fileList.elementAt(i);

               // --- Process the file data

               java.io.File dataFile = new java.io.File(oneFile.getName());

               java.io.FileReader reader = new java.io.FileReader(dataFile);

               char []cbuf = new char[(int) dataFile.length()];

               reader.read(cbuf,0,(int)dataFile.length());

               smtpMailSender.postMail( emailList,
                                  oneFile.getType(),
                                  new String(cbuf),
                                  mySenderEmail,
                                  myUserId,
                                   myUserPwd);

               reader.close();

         }

}

          aMessageContext.getB2BStartupContext().getLogger().logInformation(

                           "Sucessfully Sent mail to All Users");

          String[] args = new String[1];

         args[0] = dataPkt.getReceiver();

         aMessageContext.getB2BStartupContext().getLogger().logDBEvent(

                            trkId, SUCCESS_MSG, args);

      } catch ( Exception aEx) {

         try{

           aMessageContext.getB2BStartupContext().getLogger().logError(

                  "An exception occured in sending the message : " +
                       aEx.getMessage());

           aMessageContext.getB2BStartupContext().getLogger().logDBEvent(

                  SOME_ERR, B2BLogger.ERROR, aEx.getMessage(), trkId);

         } catch(com.sun.iis.b2b.core.util.LoggerException aExp){

             System.err.println("Could not log Error message : "

                             + "An exception occured in sending the message : "
                                    + aEx.getMessage());

         }

         throw new SendException("An exception occured in sending the message :

                                    " + aEx.getMessage());

         }

     };

/**

* Validate the packet data and get the required parameters

* Note: The usage of the B2BRequestPacket class to

* get information from the request packet.

* @param aDataPkt is the B2BRequestPacket

* @param throws InitializationException if a required

* parameter is missing or any other problem occurs

*/

    private void readRequestData(B2BRequestPacket aDataPkt)

            throws InitializationException{

       try{

            mySMTPMailHost = aDataPkt.getTagValue("P1");

       if (mySMTPMailHost == null ){

            throw new InitializationException(" Required parameter Mail Host
missing.");

        } else if ( mySMTPMailHost.equals("")){

            throw new InitializationException(" Required parameter Mail Host
is empty.");

        }

        String tmpValue = aDataPkt.getTagValue("P2");

        if (tmpValue != null ){

             if ( !tmpValue.equals("") ) {

                        mySMTPMailHostPort = Integer.parseInt(tmpValue);

             }

        }

           mySender = aDataPkt.getTagValue("P3");

           if (mySender == null){

                throw new InitializationException(" Required parameter Sender
missing.");

        } else if ( mySender.equals("")){

                throw new InitializationException(" Required parameter Sender
is empty.");

        }

           mySenderEmail = aDataPkt.getTagValue("P4");

          if (mySenderEmail == null){

                throw new InitializationException(" Required parameter Sender
Email missing.");

        } else if ( mySenderEmail.equals("")){

                throw new InitializationException(" Required parameter Sender
Email is empty.");

        }

            myReceiver = aDataPkt.getTagValue("P5");

          if (myReceiver == null) {

                throw new InitializationException(" Required parameter
Receiver missing.");

           } else if ( myReceiver.equals("")){

                throw new InitializationException(" Required parameter
Receiver is empty.");

}

            myReceiverEmail = aDataPkt.getTagValue("P6");

           if ( myReceiverEmail == null){

               throw new InitializationException(" Required parameter Receiver
Email missing.");

           } else if ( myReceiverEmail.equals("")){

               throw new InitializationException(" Required parameter Receiver
Email is empty.");

          }

            myUserId = aDataPkt.getTagValue("P7");

if ( myUserId == null){

               throw new InitializationException(" Required parameter User Id
missing.");

           } else if ( myUserId.equals("")){

               throw new InitializationException(" Required parameter User Id
is empty.");

           }

            myUserPwd = aDataPkt.getTagValue("P8");

          if ( myUserPwd == null){

               throw new InitializationException(" Required parameter User
Password missing.");

           } else if ( myUserPwd.equals("")){

               throw new InitializationException(" Required parameter User
Password is empty.");

           }

      } catch (Exception aEx){

              throw new InitializationException("The send agent could not be
initialized correctly."

                                    + aEx.getMessage());

        }

     }

}

Locate the Java Communications Agent example plug-in code here:
ECXPERT_HOME/NS-apps/ECXpert/javacomm/example.

Locate the documentation for the example plug-in code here:
ECXPERT_HOME/NS-apps/ECXpert/javacomm/example/docs.

Receive Communications Agents

To create a receive Communications Agent, you must implement the following interfaces using the provided Java Framework:

You create a B2BInboundCommAgentFactory factory, which initializes your implementation of the B2BInboundCommAgent.

Locate the documentation for the Java framework, which describes these interfaces, here:
ECXPERT_HOME/NS-apps/ECXpert/javacomm/docs.

ECXPERT_HOME is the location of your ECXpert installation.


Note

The custom Java framework for receive Communications Agents does not support scheduled receive.


Required Methods for B2BInboundCommAgent

The B2BInboundCommAgent interface contains two methods you must call within the implementation of the interface:

Table 1  B2BInboundCommAgent Methods 

Method

Description

startUp()

The CommAgentManager calls this method on the inbound Communications Agent to bootstrap the agent.

shutDown(B2BStartupContext aCtx)

The CommAgentManager calls this method on the inbound Communications Agent to shut down the agent. ECXpert’s Native C++ Server calls this method when you shut down the agent from the ECXpert Administration interface.

The receive Communication Agent should exit all active threads gracefully on shutdown. If you find that all threads are not completing, increase the setting of the java_thread_wait_interval parameter for the receive Communications Agent in the ecx.ini file.

Example Receive Implementation

In the case of the example receive Communications Agent included with ECXpert, the B2BInboundCommAgentFactoryImpl class initializes and returns a B2BInboundMailCommAgent interface in the implementation of the createInboundCommAgent() method.

The messageHandler.java file shipped with the example Java Communications Agent shows how the example handles a document received by ECXpert.

Code Example 2 shows two methods from the messageHandler class:

Method

Description

isPartnershipValid

This method checks the validity of a partnership by checking the message’s parameters against ECXpert’s defined partnerships.

If the sender, receiver, and the subject (which is the received document type) of a message match a defined partnership, information is sent to the ECXpert logger file.

writeMessageToFile

This method writes the attached file to the tmp working directory specified in the ecx.ini file for the receive Communications Agent.

Code Example 2  Checking Partnership and Writing to a File 

/**

* Check is the partnership is valid

* @param aLoginObj - is the login object

* @param aSender - Sending member whose EL matches the From Address

* @param aReceiver - Receiving member whose ER matches the From Address

* @param aFileType - is the subject of the email should match a filetype

* @return true is a Partnership exists between aSender, aReceiver with

* doctype = aFileType

*/

private boolean isPartnershipValid(JEcxLogin aLoginObj,
                                      String aSender,
                                       String aReceiver,

                                       String aFileType){

    try{

        JEcxPartnership

        partnership = new JEcxPartnership();

        partnership.setLogin(aLoginObj);

        partnership.clear();

        partnership.setSenderName(aSender);

        partnership.list();

        while(partnership.more() > 0) {

           if ( partnership.getReceiverName().equals(aReceiver) &&

                   partnership.getDocType().equals(aFileType) ){

                   myContext.getLogger().logInformation(" Partnership is
valid... ");

                   return true;

           }

           partnership.next();

        }

     } catch (Exception aEx){

       try {

          myContext.getLogger().logError(

                 "Error in validating partnership " + aEx.getMessage());

         } catch (LoggerException aExp) {

            aExp.printStackTrace();

          }

         return false;

     }

    return false;

  }

/**

* Write message contents to a file and return the file name

*/

public String writeMessageToFile(Message aMailMessage){

try{

   Object content = aMailMessage.getContent();

      if(content instanceof Multipart) {

         myContext.getLogger().logError("Multipart messages not supported .");

         return null;

      }else{

   String filename = myTempDir + java.io.File.separator
                   + (new java.util.Date()).toString() + ".txt";

   FileWriter fw = new FileWriter( filename);

   fw.write((String)content);

   fw.close();

   return filename;

  }

 } catch (Exception aEx){

   aEx.printStackTrace();

   return null;

  }

}

Locate the Java Communications Agent example plug-in code here:
ECXPERT_HOME/NS-apps/ECXpert/javacomm/example.

Locate the documentation for the example plug-in code here:
ECXPERT_HOME/NS-apps/ECXpert/javacomm/example/docs.


Configuring Custom Java Communications Agents

This section describes the configuration parameters you must set in the ECXpert configuration file (ecx.ini) for Java Communications Agents. You can locate ECXpert‘s ecx.ini file here:
ECXPERT_HOME/NS-apps/ECXpert/config/ecx.ini

ECXPERT_HOME is the location of your ECXpert installation.

There are three sub-sets of parameters used for Java Communications Agents:

Common Agent Parameters

Provide descriptions for configuration parameters common to all Java send and receive Communications Agents.

Send Agent Parameters

Provide descriptions for configuration parameters specific to Java send Communications Agents.

Receive Agent Parameters

Provide descriptions for configuration parameters specific to Java receive Communications Agents.

Send and receive Communications Agents require a combination of parameters common to both Communications Agents, and specific to each Communications Agent.

It might be helpful for you to print a listing of your ecx.ini file for a reference while reading this section.

Common Agent Parameters

Table 2 lists the send and receive configuration parameters that are common to both Communications Agents.

Many of the parameters defined are similar to parameters defined for SNMP Communications Agents. This table lists the actual parameter name specified in the ecx.ini file.

The Change Required column defines whether or not it is necessary for you to change the current value to create your own Java Communications Agent. A value of “maybe” implies that your specific implementation might require a change.


Note

Table 3 and Table 4 describe the parameters specific to send and receive Communications Agents, respectively.


Table 2  Common Java Communications Agents Parameters  

Parameter

Description and Value

Change Required?

server_type

The server_type parameter for the Communications Agent.

This must be a unique numeric value for each Communication Agent.

yes

snmp_trap_flag

Trap information for SNMP service?

Restrictions—valid values: yes, no

Default: no

no

snmp_trap_level

SNMP event level to trap.

Restrictions—valid values:

- 0 = all messages
- 10 = information, warning, and error mesages
- 20 = warning and error messages
- 30 = error messages only
Default: 0

no

section_type

Type of section for the Communications Agent.

Restrictions—Must be server; do not change.

no

protocol_id

Protocol identifier.

Default: 3

no

port_location

Location to pick up the port.

Default: mmap

no

max_listeners

Maximum number of listener threads that are allowed. Base on concurrent processing needs, if multiple submission units are to be processed in parallel.

Restrictions—Total number of threads you specify must be supported by your hardware.

Default: 1

no

listener_level

Listener level. Number of listener threads to launch on startup.

Default: 1; do not change.

no

listener_type

Listener type.

Restrictions—valid values:

- thread = runs as a thread
- process = runs as a process

Default: thread

no

runnable_flag

Can executable be run?

Restrictions—valid values:

- yes = executable will be run as needed
- no = executable will not be run (for example, in a test situation)

Default: yes

no

thread_mode

Thread operational mode

Restrictions—valid values:

- threaded = run threaded
- serialized = run serialized

Default: threaded (only the Admin. server should be serialized; in all other sections where section_type=server, it is strongly recommended that you leave this setting as threaded)

no

listener_time_out

Listener timeout, in seconds.

Default: 10

no

admin_time_out

Admin server timeout period, in seconds.

Default: 10

no

start_mode

Server start mode.

Restrictions—valid values: commandline, background

Default: background

no

Machine Dependent Information

host_name

IP address of host machine where instances of executable are run.

Restrictions—Must be a valid IP address in your domain.

Default: set during installation.

For each send Communications Agent you define, use the host_name value set in any of the other Communications Agent Machine dependent information sections in your ecx.ini file.

no

File and directory information

exec_path

For a Java send Communications Agent:

the path to the b2bjavasendmain executable:
ECXPERT_HOME/NS-apps/ECXpert/bin/
b2bjavasendmain

For a Java receive Communications Agent:

the path to the b2bjavareceivemain executable:
ECXPERT_HOME/NS-apps/ECXpert/bin/
b2bjavareceivemain

yes

Multi-threading parameters

max_thread_flag

Limit the number of threads running in system?

Restrictions—valid values: yes, no

Default: yes

no

worker_max_threads

Number of worker threads to run in parallel.

Default: 4

no

master_max_threads

Number of master threads to run in parallel.

Default: 4

no

master_max_threads_
queued_flag

Queue master threads above master_max_threads?

Restrictions—valid values: yes, no

Default: yes

no

master_max_threads_queued

Maximum number of master threads to queue.

Default: 500

no

master_max_threads_stacked

Maximum number of master threads to place on stack.

Default: 500

no

Port Information

admin_port

Administrative port number.

Restrictions: Ports used by ECXpert must not be used by other applications.

Default: 50519; set during installation.

Change if you used a different port number at installation.

no

admin_port_type

Administrative port type.

Restrictions—valid values:

- dynamic = Administrative Server assigns
- manual = always use value in admin_port

Default: dynamic

no

listener_port

Listener port number.

Restrictions: Ports used by ECXpert must not be used by other applications.

Default: 50504; set during installation.

Change if you used a different port number at installation.

no

listener_port_type

Listener port type. Only set when adding your own network_id.

Restrictions—valid values:

- dynamic = Administrative Server assigns
- manual = always use value in admin_port

Default: dynamic

no

Configurable Options

restart_flag

Restart this executable automatically if it experiences an abnormal exit?

Restrictions—valid values:

- yes = automatically restart when ECXpert is restarted - (you are confident manual intervention is not required)
- no = do not restart when ECXpert is restarted- (you expect that manual intervention might be required)

Default: no

no

autostart_flag

Start communications servers automatically when ECXpert is started?

Restrictions—valid values:

-yes
-no

Default: yes

no

Debug Output Configuration

debug_flag

Turn on low level tracing information?

Restrictions—valid values:

-yes
-no

Default: no

maybe

redirect_stdout
redirect_stderr

When set to yes, the output directed to stdout and stderr is redirected to the files specified in the stdout_path and stderr_path parameters.

Restrictions—valid values:

-yes
-no

Default: yes

maybe

stdout_path

Fully specified path for log file to receive standard output from low level trace.

Send: ECXPERT_HOME/NS-apps/
ECXpert/data/log/ECXpert.log.
commjava-send.dat

Receive: ECXPERT_HOME/NS-apps/
ECXpert/data/log/ECXpert.log.
commjava-receive.dat

no

stderr_path

Fully specified path for log file to receive standard output from low level trace.

Send: ECXPERT_HOME/NS-apps/
ECXpert/data/log/ECXpert.log.
commjava-send.dat

Receive: ECXPERT_HOME/NS-apps/
ECXpert/data/log/ECXpert.log.
commjava-receive.dat

no

log_dir

Full path to directory for log files.

Default: ECXPERT_HOME/NS-apps/
ECXpert/data/log

no

log_prefix

File prefix used for name generation.

Default: ECXpert.log.admin.dat

no

log_flag

Should entry appear in the logging API?

Restrictions—valid values:

-yes
-no

Default: yes

no

Send Agent Parameters

In addition to parameters common to both send and receive Communications Agents, there are parameters that are specific to send Communications Agents. Table 3 shows ecx.ini parameters specific to Java send Communications Agents.

The Change Required column defines whether it is necessary to change the current value to create your own Java send Communications Agent. A value of “maybe” implies that your specific implementation might require a change.

Table 3  Java send Communications Agent Specific Parameters 

Parameter

Description and Value

Change Required?

section name

The name associated with the internal_name parameter within ECXpert. This parameter should appear at the beginning of each Communications Agent section.

Use the form [user-defined-x].

For more information, see internal_name in this table.

yes

type

Type of executable.

Restrictions: must be daemon, do not change.

no

operation

Restrictions: must be send, do not change.

no

is_comm_agent

Restrictions: must be yes, do not change.

no

pre_enveloped_edi

Allow retrieval of EDI documents with existing envelopes?

Restrictions—valid values:

- true = yes, pre-enveloped
- false = no, not pre-enveloped

Default: true

maybe

bundle_all

Package all data together as one file (one body part)?

Note: Do not set this parameter to yes with EDI data. Sending multiple interchanges in one E-mail violates EDI standards; ECXpert will not send EDI data if bundle_all is set to true.

Restrictions—valid values:

- yes
- no

Default: no

maybe

use4digit_year

Use all four digits for year, for year 2000 compliance?

Restrictions—valid values:

- yes = use all four digits, year 2000 compliant
- no = use only last two digits, not year 2000 compliant

Default: yes

Note: Only applicable in versions of X12 standard that support an 8-digit GS04 value (specifically, version 3072 and version 4010 and later versions).

no

multi_part

Enable sending of multiple body parts (attachments) using MIME?

Restrictions—valid values:

- yes
- no

Default: yes

maybe

num_jvm_properties

Number of JVM properties specified. There should be an equal amount of JVM properties specified in the jvm_propertyn parameter as the value set for this parameter.

Default: 2

yes

jvm_propertyn

This parameter must have 1...n JVM properties specified where n = num_jvm_properties above.

For example, if n = 2, you must specify jvm_property1 and jvm_property2

Note: Always retain the two jvm_properties already set in the Communication Agent.

jvm_property1 = -Djava.library.path = ...
jmv_property2
= -Djava.class.path = ...

The java.class.path system property must always contain the following paths:

ECXPERT_HOME/NS-apps/ECXpert/javacomm/lib/javacomm.jar

ECXPERT_HOME/NS-apps/ECXpert/javacomm/lib/b2bcomm.jar

ECXPERT_HOME/NS-apps/ECXpert/javacomm/lib/ecxsdkjni.jar

ECXPERT_HOME/NS-apps/ECXpert/javacomm/lib/ecxcpplogger.jar

If you plan to clone a send Communications Agent in the ecx.ini file of another machine’s ECXpert installation, you must update the jvm_property class and library paths to point to the correct paths for that instance of ECXpert.

yes

ignore_unrecognized_
jvm_property

Ignore a non-standard JVM system property?

Restrictions—valid values:

- yes
- no

Default: yes

maybe

comm_agent_factory_
class

Fully qualified classname of the class that implements the B2BOutboundCommAgentFactory interface.

yes

parameter_name_m

Specify m protocol parameters that you can configure from the Outgoing Protocol parameters tab of the Partnership tab in the ECXpert Support interface.

Match each parameter_name_m with a parameter_type_m to define the type of widget associated with the parameter.

yes

parameter_type_m

Specify the type of UI widget for parameter_name_m by specifying a matching parameter_type_m.

Valid values:

textbox – displays a textbox.

password – displays a textbox with all text characters appearing as asterisks “*”.

dropdown – displays a dropdown box. When defining parameter_type_m as a dropdown, the parameter_name_m should be of the form: DropDownLabel ? Item1 ? Item2 ? Item3 ? Item4 ? ...

Note: If parameter_type_m is not specified for a parameter_name_m, the parameter type defaults to textbox.

Optional
(See note)

internal_name

The name used internally within ECXpert.

USER DEFINED x

where x = 1...n

Note: You must use the form USER DEFINED x for the internal_name.

Use the form user-defined-x for the corresponding section_name that begins the send Communication Agent section.

yes

visible_name

The name displayed externally by ECXpert.

In the case of the example plug-in Java Communications Agent installed with ECXpert, the visible_name is CustomJava SMTPSend.

yes

The ecx.ini file installed with ECXpert contains a plug-in example of a Java send Communications Agent. Code Example 3 shows the section specific to an ECXpert send Communications Agent. To view the section, open the ecx.ini file in a text editor and search for B2B Java Send Section.

Code Example 3  Java send Communications Agent Parameters in ecx.ini File 

#

# This is the name of the ecx.ini section for the send agent.

# It appears at the top of the section. The agent name must follow

# the convention user-defined-x and match the internal_name parameter.

# defined later in the agent’s section.

#

[user-defined-3]

#

# Common receive agent parameters skipped here. See ecx.ini file for

# skipped parameters.

#

#

# File and directory information

#

exec_path = /export/iisb2b/ecx363_migrate/NS-apps/ECXpert/bin/b2bjavasendmain

#

# Common receive agent parameters skipped here. See ecx.ini file for

# skipped parameters.

#

#

# Outbound Comm Agent Specific Properties

#

type=daemon

opertaion = send

is_comm_agent = yes

pre_enveloped_edi = True

bundle_all = yes

use4digit_year = yes

multi_part = yes

#

# JVM Specific Properties

#

# num_jvm_properties specified how many jvm properties are specified here.

# You can specify 1..num_jvm_properties.i.e. jvm_property[1..n] where

# n = num_jvm_properties

#

# ignore_unrecognized_jvm_property specifies whether a unrecognized

# jvm_property is to be ignored {yes/no}

#

num_jvm_properties = 2

jvm_property1 =

-Djava.library.path=/export/iisb2b/ecx363_migrate/NS-apps/ECXpert/lib:/export/

iisb2b/ecx363_migrate/NS-apps/ECXpert/bin/Solaris_JRE_142/lib/sparc

jvm_property2 =

-Djava.class.path=/export/iisb2b/ecx363_migrate/NS-apps/ECXpert/javacomm/lib/b

2bcomm.jar:/export/iisb2b/ecx363_migrate/NS-apps/ECXpert/javacomm/lib/javacomm

.jar:/export/iisb2b/ecx363_migrate/NS-apps/ECXpert/ecxsdk/jni/ecxsdkjni.jar:/e

xport/iisb2b/ecx363_migrate/NS-apps/ECXpert/ecxsdk/jni/ecxcpplogger.jar:/expor

t/iisb2b/ecx363_migrate/NS-apps/ECXpert/javacomm/lib/activation.jar:/export/ii

sb2b/ecx363_migrate/NS-apps/ECXpert/javacomm/lib/mail.jar:/export/iisb2b/ecx36

3_migrate/NS-apps/ECXpert/javacomm/lib/smtp.jar

ignore_unrecognized_jvm_property = yes

#

# CommAgentFactoryClass Instance

#

comm_agent_factory_class =

com.sun.iis.b2b.bdg.example.B2BOutboundCommAgentFactoryImpl

#

# Custom Communication Agent UI specific properties

#

parameter_name_1 = SMTP Mail Host

parameter_type_1 = textbox

parameter_name_2 = SMTP Mail Host Port

parameter_name_3 = Sender

parameter_name_4 = Sender Email

parameter_name_5 = Receiver

parameter_name_6 = Receiver Email

parameter_name_7 = User Id

parameter_name_8 = User Password

parameter_type_8 = password

parameter_name_9 = Unused Parameter ? item1 ? item2

parameter_type_9 = dropdown

internal_name = USER DEFINED 3

visible_name = CustomJava SMTPSend

#

# Debug output configuration.

#

debug_flag = no

redirect_stdout = yes

redirect_stderr = yes

stderr_path =

/export/iisb2b/ecx363_migrate/NS-apps/ECXpert/data/log/ECXpert.log.commjava-

send.dat

stdout_path =

/export/iisb2b/ecx363_migrate/NS-apps/ECXpert/data/log/ECXpert.log.commjava-

send.dat

log_flag = yes

log_prefix = ECXpert.log.commjava-send.dat

log_dir = /export/iisb2b/ecx363_migrate/NS-apps/ECXpert/data/log

When you select CustomJava SMTPSend as the Outgoing Protocol from the Partnership tab, the B2B Java Send Section of the ecx.ini file results in the Protocol screen pictured in Figure 2.

The parameter types and names specified in the ecx.ini file appear in the Parameters section of the Protocols screen.

Figure 2  Protocol Tab for CustomJava SMTPSend Defined in ecx.ini File

Receive Agent Parameters

In addition to parameters common to all Java send and receive Communications Agents, there are parameters you must set in the ecx.ini file that are specific to receive Communications Agents. Table 4 shows ecx.ini parameters you must set for your Java receive Communications Agents.

The Change Required column defines whether it is necessary to change the current value to create your own Java receive Communications Agent. A value of “maybe” implies that your specific implementation might require a change.

Table 4  Java receive Communications Agent Specific Parameters 

Parameter

Description and Value

Change Required?

section name

The name associated with the receive Communications Agent. This name appears at the beginning of each Communications Agent section.

Unlike the Java send Communications Agent, there is no restriction on the section name for the Java receive Communications Agent. You do not have to use the form user-defined-x.

yes

num_jvm_properties

Number of JVM properties specified. There should be an equal amount of JVM properties specified in the jvm_propertyn parameter as the value set for this parameter.

Default: 2

yes

jvm_propertyn

This parameter must have 1...n JVM properties specified where n = num_jvm_properties above.

For example, if n = 2, you must specify jvm_property1 and jvm_property2

Note: Always retain the two jvm_properties already set in the Communication Agent.

jvm_property1 = -Djava.library.path = ...
jmv_property2
= -Djava.class.path = ...

The java.class.path system property must always contain the following paths:

ECXPERT_HOME/NS-apps/ECXpert/javacomm/lib/javacomm.jar

ECXPERT_HOME/NS-apps/ECXpert/javacomm/lib/b2bcomm.jar

ECXPERT_HOME/NS-apps/ECXpert/javacomm/lib/ecxsdkjni.jar

ECXPERT_HOME/NS-apps/ECXpert/javacomm/lib/ecxcpplogger.jar

If you plan to clone a receive Communications Agent in the ecx.ini file of another machine’s ECXpert installation, you must update the jvm_property class and library paths to point to the correct paths for that instance of ECXpert.

yes

ignore_unrecognized_
jvm_property

Ignore a non-standard JVM system property?

Restrictions—valid values:

- yes
- no

Default: yes

maybe

comm_agent_factory_class

Fully qualified classname of the class implementing the B2BInboundCommAgentFactory interface.

yes

java_thread_wait_interval

Time interval in milliseconds that ECXpert waits for any threads created by the B2BInboundCommAgent to die.

If shutdown of your receive Communications Agent takes more time, increase this value from the default value of 20000 ms.

maybe

Inbound Communications Agent Specific properties

In the plug-in example provided with ECXpert, the B2B Custom receive agent section contains the following SMTP parameters:

- mail_host

- mail_host_port

- mail_protocol

- mail_userid

- mail_userpwd

- work_dir

Parameters that are specific to the implementation of the inbound receive Communications Agent.

You must set these messaging server parameters, which are specific to your environment, in the ecx.ini file.

To encrypt the mail_userpwd password, use the bdgsetpasswd Password Utility, discussed on (more...) .

For implementation details on reading these parameters from the ecx.ini file, refer to the readConfigData()method in the B2BInboundMailCommAgent.java file for the example SMTP receive Communications Agent in the following location: ECXPERT_HOME/NS-apps/ECXpert/javacomm/example.

 

ECXpert’s ecx.ini file contains a plug-in example of a Java receive Communications Agent. Code Example 4 shows the section specific to an ECXpert receive Communications Agent. To view the section, open the ecx.ini file in a text editor and search for B2B Java Receive Section.

To configure the Communications Agent to receive messages, you must enter values for your messaging server in the Sample Inbound Comm. Agent Specific properties subsection of the B2B Java Receive Section in the ecx.ini file.

Code Example 4  Java receive Communications Agent Parameters in ecx.ini File 

###############################################

# #

# B2B Java Receive Section #

# #

###############################################

#

# This is the name of the ecx.ini section for the receive agent.

# It appears at the top of the section. The agent name does not

# have to follow the user-defined-x convention used in B2B send agents.

#

[commjava-receive]

#

# Common receive agent parameters skipped here. See ecx.ini file for

# skipped parameters.

#

#

# File and directory information

#

exec_path = /kes1/ecx_3_6_3/NS-apps/ECXpert/bin/b2bjavareceivemain

#

# Common receive agent parameters skipped here. See ecx.ini file for

# skipped parameters.

#

#

# JVM Specific Properties

#

# num_jvm_properties specified how many jvm properties are specified here.

# You can specify 1..num_jvm_properties.i.e. jvm_property[1..n] where

# n = num_jvm_properties

#

# ignore_unrecognized_jvm_property specifies whether a unrecognized

# jvm_property is to be ignored {yes/no}

#

num_jvm_properties = 2

jvm_property1 =

-Djava.library.path=/export/iisb2b/ecx363_migrate/NS-apps/ECXpert/lib:/export/

iisb2b/ecx363_migrate/NS-apps/ECXpert/bin/Solaris_JRE_142/lib/sparc

jvm_property2 =

-Djava.class.path=/export/iisb2b/ecx363_migrate/NS-apps/ECXpert/javacomm/lib/

b2bcomm.jar:/export/iisb2b/ecx363_migrate/NS-apps/ECXpert/javacomm/lib/

javacomm.jar:/export/iisb2b/ecx363_migrate/NS-apps/ECXpert/ecxsdk/jni/

ecxsdkjni.jar:/export/iisb2b/ecx363_migrate/NS-apps/ECXpert/ecxsdk/jni/

ecxcpplogger.jar:/export/iisb2b/ecx363_migrate/NS-apps/ECXpert/javacomm/lib/

activation.jar:/export/iisb2b/ecx363_migrate/NS-apps/ECXpert/javacomm/lib/

mail.jar:/export/iisb2b/ecx363_migrate/NS-apps/ECXpert/javacomm/lib/smtp.jar:/

export/iisb2b/ecx363_migrate/NS-apps/ECXpert/javacomm/lib/pop3.jar

ignore_unrecognized_jvm_property = yes

#

# CommAgent Factory Implementation class

#

comm_agent_factory_class =

com.sun.iis.b2b.bdg.example.B2BInboundCommAgentFactoryImpl

#

# This is the time interval in ms for which the communication agent manager

# waits for the Java thread to die.

#

#

java_thread_wait_interval = 20000

#

# Sample Inbound Comm. Agent Specific properties

#

mail_host = <mail server>

mail_host_port= <port on which the POP3/IMAP daemon is listening on mail_host>

mail_protocol = <mail protocol pop3/imap>

mail_userid = <mail user id>

mail_userpwd = <mail user encrypted password>

work_dir = <temporary work directory>

#

# Debug output configuration.

#

debug_flag = no

redirect_stderr = yes

redirect_stdout = yes

stderr_path =

/export/iisb2b/ecx363_migrate/NS-apps/ECXpert/data/log/ECXpert.log.commjava-re

ceive.dat

stdout_path =

/export/iisb2b/ecx363_migrate/NS-apps/ECXpert/data/log/ECXpert.log.commjava-re

ceive.dat

log_flag = yes

log_prefix = ECXpert.log.commjava-receive.dat

log_dir = /export/iisb2b/ecx363_migrate/NS-apps/ECXpert/data/log


Starting and Stopping Java Communications Agents

Use the ECXpert Administration interface to start and stop the Java Communications Agents as you would any other Communications Agents for ECXpert protocols. For more information on staring and stopping Communications Agents, refer to the ECXpert Administrator’s Guide.

Figure 3 shows the ECXpert Administration interface with the Custom Java SMTP (send) and Custom Java SMTP (receive) Communications Agents turned off.

Figure 3  Administration Interface Showing Java Communications Agents


Setting Up and Running the Send Example

This section describes how to set up and run the plug-in example for the Java send Communications Agent. For this example, you should set up an ECXpert user named test on your Messaging Server, with a password test. This user will send a message using the Java send Communications Agent installed with ECXpert.

    To Create a Messaging Server User
  1. Set up a user and password of test/test.
  2. This user will send a message from ECXpert using the Java send Communications Agent to a trading partner. The user will also receive the message and locate it in a mail client.

    To Modify Partnership Information to Include Messaging Server and User Information for Sending a Message
  1. From the Partnership tab, select Change.
  2. Select Search.
  3. A list of all current partnerships appears, as shown in Figure 4.

  4. Select the following default Partnership and click Retrieve.
  5. Sender

    Receiver

    Doc Type

    PartnerA

    ECX

    810

    Figure 4  Partnership Results List

  6. From the Protocol tab, select CustomJava SMTPSend from the outgoing protocol drop-down list.
  7. The parameters defined in the Java send Communications Agent section of the ecx.ini file appear in the Protocols screen.

  8. Enter values into the fields for the Partnership’s outbound Protocol as shown in Figure 5, and click Change.
  9. These fields represent the Java send Communications Agent properties for the parameters you defined in the B2B Java Send Section of the ecx.ini file.

    Figure 5  Partnership Protocols Tab

    Table 5  Outgoing Protocol Parameters 

    Field

    Value and Description

    SMTP Mail Host

    The messaging server host name.

    SMTP Mail Host Port

    The messaging server host port.

    If no port is specified, the default port is used.

    Sender

    The message sender’s name.

    Use test for this example.

    Sender Email

    The message sender’s E-mail address.

    This must be a valid E-mail address.

    Use test@yourmessagingsever.com where yourmessagingserver.com is the host name for the account you have created for user test on your messaging server.

    Receiver

    The messages receiver’s name.

    Use test for this example.

    Receiver Email

    The message receiver’s E-mail address.

    This must be a valid E-mail address.

    Use test@yourmessagingsever.com where yourmessagingserver.com is the host name for the account you have created for user test on your messaging server.

    User Id

    The User Id for logging in to the Messaging Server.

    Use test for this example.

    User Password

    The User Password for logging in to the Messaging Server.

    Use test for this example.

    To Start the send Communications Agent
  1. From the ECXpert Administration interface, start the Custom Java SMTP (send) Communications Agent.
  2. You might have to wait a few seconds for the Communications Agent to start up.

    For more information on starting Communications Agents, refer to the ECXpert Administrator’s Guide.

    To Send a Message Using ECXpert’s Document Submission Form
  1. Copy the Input_810.txt file from ECXPERT_HOME/NS-apps/ECXpert/maps to your /tmp directory on Solaris or C:\tmp directory on Windows.
  2. Use the Document Submission Form to submit the 810.txt file as shown in Figure 6.
  3. Figure 6  Document Submission Form

    Table 6  Document Submission Form Information 

    Field

    Value and Description

    Sending Member

    The member ID for the sending member you defined in the associated partnership.

    Use PartnerA for this example.

    Password

    The sending member’s Password.

    Receiving Member

    The member ID of the receiving member you defined in the associated partnership.

    Use ECX for this example.

    File Name

    The name of the file to submit to ECXpert (the submission unit).

    On Solaris: /tmp/Input_810.txt

    On Windows: C:\tmp\Input_810.txt

    File Type

    The Document Type for the file as defined in the Service List.

    Use EDI for this example.

    If the document submission is successful, a message appears, as shown in Code Example 5. Make a note of the tracking ID in the success window. In this case, the tracking number is 235.

    Code Example 5  Document Submission Successful Message 

    Submitting...

     

    Sender: PartnerA

     

    Password: **********

     

    Receiver: ECX

     

    ECX Ini File: /export/home/ecxadmin/ECX363_INT/NS-apps/ECXpert/config/ecx.ini

     

    Submit File Name: /tmp/Input_810.txt

     

    Submit File Type: EDI

     

    Submission is successful, and the tracking ID is: 235

     

    Done

    To Check Your Mail Client to Make Sure Message Was Successfully Sent
  1. Log in to the mail client as test/test as shown in Figure 7 to verify that the message sent in by the Submission Form was received by user test.
  2. Figure 7  Mail Client Login Screen

  3. Retrieve E-mail messages using you mail client.
  4. The message should appear in the Inbox as shown in Figure 8.

    Figure 8  Mail Client Interface Showing Received Messages in Inbox

    To Check ECXpert’s Event Log to Make Sure Message Was Successfully Sent
  1. From the Support Interface, select Tracking.
  2. Select the Event Log Tab.
  3. To view Send error events, specify a specific tracking ID.
  4. If the message was sent successfully, it should appear in the event log as shown in Figure 9.

    Figure 9  ECXpert Event Log With Send Events Shown


Setting Up and Running the Receive Example

This section describes how to set up and run the plug-in example for the Java receive Communications Agent. For this example, you use the same ECXpert user named test on your Messaging Server, with a password test.

This user will receive a message using the Java receive Communications Agent installed with ECXpert.


Note

You must complete the send example section before you begin the receive example. See Setting Up and Running the Send Example.


    To Modify the B2B Java Receive Section of the ecx.ini File
  1. Edit the messaging server information for the receive Communications Agent in the ecx.ini file and save the file.
  2. To find this section, open the ecx.ini file in a text editor and search for [commjava-receive]. The inbound specific parameters are shown in Code Example 6.

    Code Example 6  Messaging Server B2B Java Receive Section of ecx.ini File

    #

    # Sample Inbound Comm. Agent Specific properties

    #

    mail_host = <mail server>

    mail_host_port= <port on which the POP3/IMAP daemon is listening on mail_host>

    mail_protocol = <mail protocol pop3/imap>

    mail_userid = <mail user id>

    mail_userpwd = <mail user encrypted password>

    work_dir = <temporary work directory>

    Table 7 shows the list of receive Communications Agent messaging server parameters and their descriptions for this example.

    Table 7  Receive Communications Agent Messaging Server Information 

    Parameter

    Description

    mail_host

    The messaging server’s host name.

    Use the messaging server host name where you created the test/test account in Step 1 for this example.

    mail_host_port

    The SMTP host port.

    If the port is not specified, the default port is used.

    mail_protocol

    The mail protocol for your messaging server instance.

    pop3/imap

    mail_userid

    The User account for receiving messages.

    Use test for this example.

    mail_password

    The encrypted password for mail_userid.

    Use the password test for this example.

    To encrypt the mail_userpwd parameter, use the password utility (on one line):

    bdgsetpassword -i path/ecx.ini -s commjava-receive -param mail_userpwd -v test

    For more information about bdgsetpasswd, see Password Utility, on (more...) .

    work_dir

    Temporary working directory.

    Use /tmp for this example.


    Note

    The messaging server values remain static within the ecx.ini file. In this way, the Communications Agent acts as a simple static listener for received messages.


    To Modify/Create Members Using the Membership Tab

The Custom Java SMTP (receive) Communications Agent validates received mail as follows:

A Partnership should exist between the Sender/Receiver with the determined document type. In this case, the Sender is PartnerA and the Receiver is a new member Test1.

  1. Set the EL of Sending member PartnerA.
    1. From the Membership tab, click Change.
    2. Select PartnerA from the drop-down list and click Retrieve.
    3. Select the Trading Addresses tab.
    4. The trading addresses tab appears.

    5. Select Local E-Mail from the Address Type drop-down list, enter the E-mail address for your test user, and click Add.
    6. The new EL for PartnerA appears in the Existing Trading Address table as shown in Figure 10.

    7. Click the Change button located at the bottom of the Trading Addresses window.
    8. Figure 10  Sending Member’s (PartnerA) Local E-mail (EL) Address

  2. Add a new Receiving member test1.
    1. From the Membership tab, click Add.
    2. Enter Test1 in the Member ID field on the Membership Information tab.
    3. Enter Test1 in the Full Name field on the Contact Information tab.
    4. Click the Trading Addresses tab.
    5. Select Remote E-Mail from the Address Type drop-down list, enter the E-mail address for your test user, and click Add.
    6. The new ER for Test1 appears in the Existing Trading Address table as shown in Figure 11.

    7. Click the Add button located at the bottom of the Trading Addresses window.
    8. Figure 11  Receiving Member’s (Test1) Remote E-mail (ER) Address

    To Create a Partnership to Use the Custom Java SMTP (receive) Communications Agent
  1. Click Add from the Partnership tab.
  2. Select PartnerA from the Sending Member drop-down list.
  3. Select Test1 from the Receiving Member drop-down list.
  4. Specify EDI for the document type.
  5. Figure 12 shows the Partnership Information window.

    Figure 12  Partnership Information for receive Communications Agent

  6. From the Protocol tab, select FTP from the Outgoing Protocol drop-down list.
  7. Fill in the fields for your FTP server as shown in Figure 13 and click Add.
  8. For more information on specifying FTP Protocol information, refer to the Chapter “Setting up Trading Partnerships,” available from the ECXpert Administrator’s Guide.

    Figure 13  Partnership Protocol for receive Communications Agent

    To Create a Service List to Process Retrieved Documents
  1. From the Services tab, click Add.
  2. Select the following services and click the Add button in the middle of the window:
    • OutPrep
    • gateway
  3. Specify the Service List Details as shown in Figure 14 and click the Add button at the bottom of the Services window.
  4. Figure 14  Service List Details for receive Communications Agent

    Service List Details Field

    Description and Value

    Service List Name

    The name of the service list. This can be any unique name.

    Use testJavaRecv for this example.

    Service List Data Type

    The File type for the service list is EDI.

    The document will be submitted with Filetype = Subject = EDI

    Sending Member

    PartnerA

    Receiving Member

    Test1

    To Start the Custom Java SMTP (receive) Communications Agent
  1. From the ECXpert Administration interface, start the Custom Java SMTP (receive) Communications Agent.
  2. You might have to wait a few seconds for the Communications Agent to start up.

    For more information on starting Communications Agents, refer to the ECXpert Administrator’s Guide.

    To Check Your Mail Client for Received Messages

The receive Communications Agent should have received a message from the Document Submission you performed in Step 2.

  1. Login to your mail client as test/test as shown in Figure 15 to verify that the message was received by user test.
  2. Figure 15  Mail Client Login Screen

  3. Check for messages using your mail client.
  4. The received message should not appear in your Inbox. The example receive Communications Agent deletes messages upon successful retrieval of the document. Figure 16 shows an Inbox with no messages.

    Figure 16  Mail Client Interface Showing Empty Inbox

    To Check the Tracking Logs for Received Messages.

If the message does not appear in your mail client, check ECXpert’s Tracing logs for the javaRecv document.

  1. From the Support Interface, select Tracking.
  2. From the Enter Search Constraints tab, select the following member IDs from the Sender/Receiver drop-down lists, and click Search:
  3. List

    Member ID

    Sending Member ID

    PartnerA

    Receiving Member ID

    Test1

  4. Select the file from the Results List whose timestamp most closely matches the time you sent the document, and click Retrieve.
  5. The EDI document appears as shown in Code Example 7.

    Code Example 7  EDI Document Retrieved From File Level Results Tab

    FILE,/export/home/ecxadmin/ECX363_INT/NS-apps/ECXpert/data/work/tmp

    0, IPS PAPER PRODUCTS,ABC CORPORATION, EARL OFFICE PRODUCTS

    1,F,18,2.86

    1,F,180,.84

    1,F,36,.84

    1,F,612,.84

    1,F,36,.84

    0,IPS PAPER PRODUCTS, ABC CORPORATION, L&L PUBLISHERS

    1,F,2,95.04

    1,F,36,4.32

    1,F,18,4.32

    1,F,18,3.24

    1,F,36,3.24

    1,F,18,3.24

    1,F,36,3.24

    End of File

  6. From the File Level Results tab, click Events.
  7. Look through the events list to determine whether the FTP transfer was successful. Note the timestamp for the “FTP (APPLICATION) succeeded” event message.

  8. Navigate to the ftp server’s outbound directory, which in this case is tmp.
  9. Verify the document transferred properly by listing all *javaRecv* documents in the tmp directory, as shown in Code Example 8.
  10. Code Example 8  javaRecv Documents Received to tmp Directory

    > hostname

    nala

    > ls -lrt /tmp/*javaRecv*

    -rw-r--r--   1 ftpuser   staff   268   Sep 18  10:53  /tmp/javaRecv.A37

    -rw-r--r--   1 ftpuser   staff   268   Sep 18  10:53  /tmp/javaRecv.A38

    -rw-r--r--   1 ftpuser   staff   268   Sep 19  02:00  /tmp/javaRecv.A41

    -rw-r--r--   1 ftpuser   staff   268   Sep 19  02:00  /tmp/javaRecv.A42

    -rw-r--r--   1 ftpuser   staff   268   Sep 19  16:19  /tmp/javaRecv.A49

    -rw-r--r--   1 ftpuser   staff   268   Sep 19  16:19  /tmp/javaRecv.A50

    -rw-r--r--   1 ftpuser   staff   268   Sep 19  17:32  /tmp/javaRecv.A52

    -rw-r--r--   1 ftpuser   staff   268   Sep 19  18:41  /tmp/javaRecv.A54

    -rw-r--r--   1 ftpuser   staff   268   Sep 19  18:48  /tmp/javaRecv.A56

    -rw-r--r--   1 ftpuser   staff   268   Sep 29  23:51  /tmp/javaRecv.A59

    >


Password Utility

ECXpert provides the bdgsetpassword utility to encrypt passwords specified in the ECXpert configuration file (ecx.ini). This utility is necessary to configure passwords such as mail_userpwd in commjava-receive.

The bdgsetpassword utility can be found at the following location:

ECX_HOME/NS-apps/ECXpert/bin

ECX_HOME is the directory in which you installed ECXpert.

Environment Variables

Before you run the utility, modify your environment as follows:

On Solaris and Windows platforms, set an environment variable, BDGHOME, to point to:

ECX_HOME/NS-apps/ECXpert

On Solaris platforms, modify LD_LIBRARY_PATH to include:

ECX_HOME/NS-apps/ECXpert/lib

On Windows platforms, modify PATH to include:

ECX_HOME\NS-apps\ECXpert\lib

ECX_HOME is the directory in which you installed ECXpert.

Usage

When you run the bdgsetpasswd utility, you must specify which password you are generating, as indicated below:

bdgsetpasswd -i path/ecx.ini -s <section_name> -param <parameter_name> -v value

path: ECX_INSTALL_DIR/NS-apps/ECXpert/config
password: the password you want to encrypt for the configuration file

The utility automatically updates the ecx.ini file. After running this utility, you must restart the Java receive Communications Agent for the changes to take effect.


Troubleshooting

You can use the ECXpert Event Log to troubleshoot errors encountered when sending or receiving messages.

    To View the ECXpert Event Log
  1. From the Support Interface, select Tracking.
  2. Select the Event Log Tab.
  3. To view Receive error events, specify 0 (zero) for the tracking ID.
  4. To view Send error events, specify a specific tracking ID.

  5. Note

    To send more error information to the Error log, set the debug_flag parameter to yes in the sections for each Communications Agent.


For more information on viewing the ECXpert Event Log, refer to the Chapter “Tracking the Documents that ECXpert Processes,” available from the ECXpert Administrator’s Guide.

Table 8 lists Java Communications Agent error event numbers, the message displayed, and possible causes and remedies.

Table 8  Java Communications Agent Error Events  

Error

Description

20010

Could not find class %s.

< where %s is replaced by a classname that the Java Communications Agent engine cannot find >

Possible Causes: The particular class was not found by the Java Communications Agent engine.

Remedies: Verify that javacomm.jar is specified in java.class.path jvm_property in ecx.ini.

20011

The class %s is an invalid B2B Communications Agent Factory instance.

Possible Causes: The classname specified for the comm_agent_factory_class parameter in the ecx.ini file must implement the B2BInboundCommAgentFactory or the B2BOutboundCommAgentFactory interface. The class mentioned in the error does not implement either interface.

Remedies: Verify that the class mentioned in the error implements the B2BInboundCommAgentFactory or B2BOutboundCommAgentFactory interface.

20012

Error: Could not find method %s in class %s.

Possible Causes: The method specified in the error could not be found in the class. Either the method is not defined in the class or the class was not found.

Remedies: Verify that javacomm.jar is specified in java.class.path jvm_property in ecx.ini.

20014

An Exception was thrown by the Java Communications Agent.

Possible Causes: Some unknown exception has been thrown.

Remedies: Check the log files for more details.



Previous      Contents      Index      Next     


Copyright 2004 Sun Microsystems, Inc. All rights reserved.