Appendix: Using the Delivered Listening Connectors and Target Connectors

This appendix provides examples for using the listening and target connectors delivered with PeopleSoft Integration Broker, and discusses how to:

Click to jump to parent topicUnderstanding Using This Appendix

This appendix presents examples of how to use the connectors delivered with PeopleSoft Integration Broker.

The intention of the examples provided in this appendix is to provide a starting point for exploring how the connectors work. The examples are designed to be simple and require the minimum set up and configuration necessary to invoke them.

If you try these examples and choose to cut the code samples provided in this document and paste them into PeopleSoft Application Designer, the PeopleSoft Pure Internet Architecture, or text or XML editors, verify that single or double quotation marks are pasted into these mediums as straight quotes. Slanted or curly quotes will cause the code samples to fail.

Click to jump to top of pageClick to jump to parent topicPrerequisites

To use this appendix, you should have basic experience in using PeopleSoft Integration Broker. There is little background information presented in this appendix and many of the basic steps involved in creating integrations are presented in general terms (for example, “create a new Service/Service Operation.”) Please refer to the appropriate chapters in this PeopleBook for information on how to complete basic tasks.

Click to jump to parent topicSetting Up Metadata

This section discusses how to set up metadata for the examples presented in this appendix and discusses how to:

Click to jump to top of pageClick to jump to parent topicUnderstanding Setting Up Metadata

Before you use the examples in this appendix you must set up metadata as described in this section.

Note. The examples presented in this appendix demonstrate the use of one type of connector at a time. The examples share the same basic definitions for the service operation, request message, response message, routings, and the test page. As a result, you should attempt to run only one example at a time, since the underlying metadata and objects are shared.

The exact requirements for setting up the listening and target connectors do differ somewhat, but since the differences are fairly minor the steps are combined in this section.

Click to jump to top of pageClick to jump to parent topicPrerequisites

Before you begin the set up data for the examples configure and start the integration gateway.

Click to jump to top of pageClick to jump to parent topicCreating Services, Service Operations, Queues, and Messages

This section describes creating services, service operations, queues, and request and response messages for use in running the connector examples presented in this appendix.

Unless otherwise noted, use the appropriate PeopleSoft Pure Internet Architecture pages to complete these tasks.

To create services, service operations, queues, and messages:

  1. Create a new Service

    Name the service EXAMPLE_SERVICE.

  2. Create new synchronous Service operation.

    1. Add a service operation of type synchronous to the EXAMPLE_SERVICE service and name it EXAMPLE_SERVICE_OPR.

    2. Complete the field definitions for service operation as follows:

      Field

      Value

      Operation Description

      Test service operation

      Request Message.Version

      EXAMPLE_REQUEST_MSG.VERSION_1

      Response Message Name.Version

      EXAMPLE_RESPONSE_MSG.VERSION_1

    3. Configure the Service Operation Security for this service operation.

  3. Create a new asynchronous Service Operation

    1. Add a service operation of type Asynchronous — one way to the EXAMPLE_SERVICE and name it EXAMPLE_SERVICE_ASYNC_OPR

    2. Complete the field definitions for the service operation as follows:

      Field

      Value

      Operation Description

      Test service operation

      Request Message.Version

      EXAMPLE_REQUEST_MSG.VERSION_1

      Queue Name

      EXAMPLE_QUEUE

    3. Configure the Service Operation Security for this service operation.

  4. Create a new queue.

    1. Name the queue EXAMPLE_QUEUE

    2. Verify that the Queue Status is set to Run.

    3. Use the Integration Broker Service Operations Monitor Administration to verify that the EXAMPLE_QUEUE is running.

  5. Create a new request message.

    Create a Nonrowset-based message with message name as EXAMPLE_REQUEST_MSG and message version as VERSION_1.

  6. Create a new response message.

    Create a Nonrowset-based message with message name as EXAMPLE_RESPONSE_MSG and message version as VERSION_1.

Click to jump to top of pageClick to jump to parent topicCreating the Test Record and Page.

This section discusses how to use PeopleSoft Application Designer to:

Creating the Test Record

You must create a work record that will be used on the Test Page.

Create a new record:

  1. Insert the character field TEST into the record.

  2. Select Derived/Work as the Record Type.

  3. Save the record as EXAMPLE_WORKREC.

Creating the Test Page

You must create a test page. This page will be used in some of the target connector examples.

Create a new page with a single push button on it:

  1. Create the page.

  2. Add a push button with the following properties:

    Property

    Value

    Destination

    PeopleCode Command

    RecordName

    EXAMPLE_WORKREC

    Field Name

    TEST

  3. Re-size the button and label it Test target connector.

  4. Save the page as EXAMPLE_PAGE.

  5. Add the page to a component. This may be an existing component or a new one. Ensure that the security settings for the component allow the new page to be accessed.

Click to jump to top of pageClick to jump to parent topicCreating Nodes and Routing Definitions

Use the PeopleSoft Pure Internet Architecture to complete the following tasks.

Creating Source Nodes and Inbound Routing for service operations

You must create a node that will be the source of all requests to the listening connectors.

To create a source node and a inbound routing:

  1. Add a new node called SOURCENODE. Enter in appropriate values for the description and the default user ID. Verify that the Active Node check box has been selected. Save this node.

  2. Add a new inbound routing to the EXAMPLE_SERVICE_OPR service operation and name it EXAMPLE_SERVICE_IN_RTN.

    1. Set the Sender Node field value to SOURCENODE and the Receiver Node field value to the local node's value.

    2. Check the Active check-box for routing .

    3. Set the Logging Details field value to Header and Detail .

    4. Save the routing.

Adding Target Nodes and outbound routing

You must create a target node and an outbound routing for all outgoing requests for the target connectors.

To add a target node and an outbound routing:

  1. Add a new node called TARGETNODE. Enter in the appropriate values for the description and default user ID. Verify that the Active Node check box has been selected. Save this node.

  2. Add a new outbound routing to the EXAMPLE_SERVICE_OPR service operation and name it EXAMPLE_SERVICE_OUT_RTN.

    1. Set the Sender Node field value to the local node's value and the Receiver Node field value to TARGETNODE.

    2. Verify that the Status is set to Active.

    3. Verify that Logging Details field value is set to Header and Detail.

    4. Save the routing.

  3. Add a new outbound routing to the service operation EXAMPLE_SERVICE_OPR_ASYNC and name it EXAMPLE_SERVICE_ASYNC_RTN.

    1. Set the Sender Node field value to the local node's value and the Receiver Node field value to TARGETNODE.

    2. Verify that the Status is set to Active.

    3. Verify that Logging Details field value is set to Header and Detail.

    4. Save the routing.

Click to jump to top of pageClick to jump to parent topicSetting Up Integration Gateway Logging

The integration gateway has message and error logging capabilities. If problems arise while trying the examples, these logs can be invaluable in determining where problems are occurring.

See Managing Integration Gateway Message and Error Logging.

Click to jump to parent topicExample 1: Using the PeopleSoft Connectors

This section discusses using the PeopleSoft listening and PeopleSoft target connectors.

Click to jump to top of pageClick to jump to parent topicUnderstanding the PeopleSoft Connector Examples

The example provided for using the PeopleSoft target connector demonstrates using the connector to invoke a synchronous service operation between two PeopleSoft nodes.

The example provided for using the PeopleSoft listening connector demonstrates using Send Master to invoke a service operation into the local system for processing.

Click to jump to top of pageClick to jump to parent topicPrerequisites

To use the PeopleSoft target connector example you must have a second PeopleSoft 8.51 system. You must have the application server, the PeopleSoft Pure Internet Architecture and the Integration Gateway configured and running.

Note. In this section, the current PeopleSoft system is referred to as the originating system, and the second PeopleSoft system is called the destination system.

Click to jump to top of pageClick to jump to parent topicUsing the PeopleSoft Target Connector

This section provides an example of using the PeopleSoft target connector and describes how to:

Setting Up Data on the Originating System

To set up data on the originating system:

  1. In PeopleSoft Application Designer, open the EXAMPLE_WORKREC record. Add the following PeopleCode to the FieldChange event for the TEST field:

    &msg = CreateMessage(Operation.EXAMPLE_SERVICE_OPR); &xmldata = "<?xml version='1.0'?><ConnectorTest/>"; /* create an XmlDoc */ &xmlDoc = CreateXmlDoc(&xmldata); &rootNode = &xmlDoc.documentelement; &descNode = &rootNode.addelement("PSFTtest"); &descNode.nodevalue = "This is a test message."; /* put the XML in the message */ &msg.setxmldoc(&xmlDoc); /* send the request */ &response = %IntBroker.SyncRequest(&msg); /* and echo it back to the user */ &xmlDoc = &response.getxmldoc(); MessageBox(0, "", 0, 0, &xmlDoc.genxmlstring());

  2. In the PeopleSoft Pure Internet Architecture, open the node definition for TARGETNODE. Set the ConnectorID to PSFTTARGET.

  3. In the Integration Properties for the gateway, add a new entry for TARGETNODE along with the appropriate values.

    ig.isc.TARGETNODE.serverURL=//<machinename>:<port> ig.isc.TARGETNODE.userid=<userid> ig.isc.TARGETNODE.password=<password> ig.isc.TARGETNODE.toolsRel=<toolsRelease>

Setting Up Data on the Destination System

To set up data on the destination system:

  1. Follow the steps outlined in the section “Setting Up Metadata” to add the following to the destination system:

    1. the EXAMPLE_QUEUE queue

    2. the EXAMPLE_REQUEST_MSG message

    3. the EXAMPLE_RESPONSE_MSG message

    4. the EXAMPLE_SERVICE service

    5. the EXAMPLE_SERVICE_OPR synchronous service operation

  2. Add a node entry for the originating system. Ensure that the Single Signon security is configured so that the destination system accepts authentication tokens from the originating system.

  3. Add a new inbound synchronous routing between the originating system and the destination for the EXAMPLE_SERVICE_OPR service operation.

  4. In PIA, for service operation EXAMPLE_SERVICE_OPR add a handler of type OnRequest with implementation type App Class. Create a handler application class based on the IRequestHandler interface, and for the method OnRequest add following PeopleCode

    Local XmlDoc &xmldoc; Local File &theFile; Local XmlNode &rootNode, &descNode; Local Message &response; Local string &xmldata; /* get the body of the incoming message */ &xmldoc = &_MSG.GetXmlDoc(); /* and write it out to a file */ &theFile = GetFile("ARequest.txt", "W"); &theFile.WriteString(&xmldoc.GenXmlString()); &theFile.Close(); /* create the response message */ &response = CreateMessage(Operation.EXAMPLE_SERVICE_OPR, %IntBroker_Response); /* create the body for the response message */ &xmldata = "<?xml version='1.0'?><ConnectorTest/>"; &xmldoc = CreateXmlDoc(&xmldata); &rootNode = &xmldoc.DocumentElement; &descNode = &rootNode.AddElement("ResponseMessage"); &descNode.NodeValue = "This was generated in the OnRequest event."; /* add the body to the message */ &response.SetXmlDoc(&xmldoc); /* and return the response message */ Return &response;

Testing the PeopleSoft Target Connector

To test the PeopleSoft target connector:

  1. In the PeopleSoft Pure Internet Architecture, open the EXAMPLE_PAGE page and click the Test button. The response message will be displayed in a message box.

  2. On the destination system, open Service Operation Monitor to view the details of the received message. Open the text file created by the OnRequest PeopleCode to view the details of service operation request received.

Click to jump to top of pageClick to jump to parent topicUsing the PeopleSoft Listening Connector

This section provides an example for testing the PeopleSoft listening connector.

Testing the PeopleSoft Listening Connector

To test the PeopleSoft listening connector:

  1. In PIA , open the EXAMPLE_SERVICE_OPR service operation and add a Handler of type OnRequest with implementation type App class. The OnRequest method of App class should have following PeopleCode .

    Local XmlDoc &xmldoc; Local File &theFile; Local XmlNode &rootNode, &descNode; Local Message &response; Local string &xmldata; /* get the body of the incoming message */ &xmldoc = &_MSG.GetXmlDoc(); /* and write it out to a file */ &theFile = GetFile("HttpRequest.txt", "W"); &theFile.WriteString(&xmldoc.GenXmlString()); &theFile.Close(); /* create the response message */ &response = CreateMessage(Operation.EXAMPLE_SERVICE_OPR, %IntBroker_Response); /* create the body for the response message */ &xmldata = "<?xml version='1.0'?><ConnectorTest/>"; &xmldoc = CreateXmlDoc(&xmldata); &rootNode = &xmldoc.DocumentElement; &descNode = &rootNode.AddElement("ResponseMessage"); &descNode.NodeValue = "This was generated in the OnRequest event."; /* add the body to the message */ &response.SetXmlDoc(&xmldoc); /* and return the response message */ Return &response;

  2. Start Send Master and create an 8.48 Integration Broker (MIME) project.

  3. In the URL field enter the address of the PeopleSoft listening connector:

    http://your_server_name/PSIGW/PeopleSoftListeningConnector

    Replacing <your_server_name> with the details of the server where the gateway is running. For example:

    http://machine1234/PSIGW/PeopleSoftListeningConnector

  4. In the Requesting Node field, enter SOURCENODE.

  5. In the Ext. Operation name field, enter EXAMPLE_SERVICE_OPR.v1.

  6. From the Operation type list, select Sync.

  7. Click the Input File tab and enter the following XML:

    <?xml version="1.0"?><Test>Data</Test>

  8. Click the Post button.

    The response from the server displays in the Output Information section. Note that this is a MIME response; look near the end to find the response XML generated by the OnRequest PeopleCode. Open the text file created by the OnRequest method of application class to view the body of the request message.

Click to jump to parent topicExample 2: Using the HTTP Connectors

This section discusses how to:

Click to jump to top of pageClick to jump to parent topicPrerequisites

When using the examples for using the HTTP target connector, an HTTP server is needed to receive the HTTP request and to return a response. If using the SOAP example, the HTTP server must be able to process SOAP messages.

Click to jump to top of pageClick to jump to parent topicUsing the HTTP Listening Connector

This section provides examples of how to set credentials for HTTP requests coming into the integration gateway, and discusses how to:

Setting Up for Using the HTTP Listening Connector Examples

In PIA, for service operation EXAMPLE_SERVICE_OPR add a handler of type OnRequest with implementation type application Class. Create a handler application class based on the IRequestHandler interface, and for the method OnRequest add following PeopleCode

Local XmlDoc &xmldoc; Local File &theFile; Local XmlNode &rootNode, &descNode; Local Message &response; Local string &xmldata; /* get the body of the incoming message */ &xmldoc = &_MSG.GetXmlDoc(); /* and write it out to a file */ &theFile = GetFile("HttpRequest.txt", "W"); &theFile.WriteString(&xmldoc.GenXmlString()); &theFile.Close(); /* create the response message */ &response = CreateMessage(Operation.EXAMPLE_SERVICE_OPR, %IntBroker_Response); /* create the body for the response message */ &xmldata = "<?xml version='1.0'?><ConnectorTest/>"; &xmldoc = CreateXmlDoc(&xmldata); &rootNode = &xmldoc.DocumentElement; &descNode = &rootNode.AddElement("ResponseMessage"); &descNode.NodeValue = "This was generated in the OnRequest event."; /* add the body to the message */ &response.SetXmlDoc(&xmldoc); /* and return the response message */ Return &response;

Setting Credentials in the Message Body

To set HTTP request credentials in the message body:

  1. Start Send Master, and create a new Input File project.

  2. In the URL field enter:

    http://<your_server_name>/PSIGW/HttpListeningConnector

    Replace <your_server_name> with the details of the server where the integration gateway is running. For example:

    http://machine1234/PSIGW/HttpListeningConnector

  3. In the Input section, paste the following XML. Notice that the service operation name and requesting node are present in the XML

    <?xml version="1.0"?> <IBRequest> <ExternalOperationName>EXAMPLE_SERVICE_OPR.v1</ExternalOperation Name> <From> <RequestingNode>SOURCENODE</RequestingNode> </From> <ContentSections> <ContentSection> <Data> <![CDATA[<?xml version="1.0"?><ConnectorTest> Testing the HTTPListeningConnector. Message body. </ConnectorTest>]]> </Data> </ContentSection> </ContentSections> </IBRequest>

  4. Click the Post button to invoke service operation on the integration gateway.

  5. Check the Output section for the response. Compare the response with the XML created in the handler application class. Also check the HttpRequest.txt file created by the OnRequest PeopleCode to see the body of the request message received by the application server.

Setting Credentials in HTTP Headers

To set HTTP request credentials in the HTTP header:

  1. Start Send Master, and create a new Input File project.

  2. In the URL field enter:

    http://<your_server_name>/PSIGW/HttpListeningConnector

    Replace <your_server_name> with the details of the server where the integration gateway is running. For example:

    http://machine1234/PSIGW/HttpListeningConnector

  3. In the Headers field enter the following:

    OperationName:EXAMPLE_SERVICE_OPR.v1 From:SOURCENODE

  4. In the Input section, paste the following:

    <?xml version="1.0"?> <ConnectorTest> Testing the HTTPListeningConnector. HTTP Header. </ConnectorTest>

  5. Click the Post button to sent the message to the integration gateway.

  6. Check the Output section for the response. Compare the response with the XML created in the handler application class. Also check the HttpRequest.txt file created by the OnRequest PeopleCode to see the body of the request message received by the application server.

Setting Credentials in Query Strings

To set HTTP request credentials in a query string:

  1. Start Send Master, and create a new Input File project.

  2. In the URL field enter:

    http://your_server_name/PSIGW/HttpListeningConnector?&Operation= EXAMPLE_SERVICE_OPR.v1&From=SOURCENODE

    Replace <your_server_name> with the details of the server where the integration gateway is running. For example:

    http://machine1234/PSIGW/HttpListeningConnector?&Operation= EXAMPLE_SERVICE_OPR.VERSION_1&From=SOURCENODE

  3. In the Input section, paste the following:

    <?xml version="1.0"?> <ConnectorTest> Testing the HTTPListeningConnector. Query String. </ConnectorTest>

  4. Click the Post button to invoke service operation on the integration gateway.

  5. Check the Output section for the response. Compare the response with the XML created in the handler application class. Also check the HttpRequest.txt file created by the OnRequest PeopleCode to see the body of the request message received by the application server.

Setting Credentials in SOAP-Specific HTTP Headers

To set HTTP request credentials in a SOAP-specific HTTP header:

  1. Start Send Master, and create a new Input File project.

  2. In the URL field enter:

    http://your_server_name/PSIGW/HttpListeningConnector

    Replacing <your_server_name> with the details of the server where the gateway is running. For example:

    http://machine1234/PSIGW/HttpListeningConnector

  3. In the Header field, add the following:

    SOAPAction: http://peoplesoft.com/EXAMPLE_SERVICE_OPR.v1/SOURCENODE//

  4. In the Input section, paste the following:

    <?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.encoding/ "xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <ConnectorTest> <Text> Testing the HTTPListeningConnector. SOAP Message. </Text> </ConnectorTest> </SOAP-ENV:Body> </SOAP-ENV:Envelope>

  5. Click the Post button to invoke service operation on the integration gateway.

  6. Check the Output section for the response. Compare the response with the XML created in the handler application class; that XML will be returned wrapped in a SOAP envelope. Also check the HttpRequest.txt file created by the OnRequest PeopleCode to see the body of the request message received by the application server.

Click to jump to top of pageClick to jump to parent topicUsing the HTTP Target Connector

This section provides examples of using the HTTP target connector and discusses how use the connector to:

Sending Standard HTTP Requests

To send a standard HTTP request:

  1. In PeopleSoft Application Designer, open the EXAMPLE_WORKREC record and add the following PeopleCode to the FieldChange event for the TEST field.

    &msg = CreateMessage(Operation.EXAMPLE_SERVICE_OPR); &xmldata = "<?xml version='1.0'?><ConnectorTest/>"; /* create an XmlDoc */ &xmlDoc = CreateXmlDoc(&xmldata); &rootNode = &xmlDoc.documentelement; &descNode = &rootNode.addelement("HTTPtest"); &descNode.nodevalue = "This will be sent to an HTTP server."; /* put the XML in the message */ &msg.setxmldoc(&xmlDoc); /* send the request */ &response = %IntBroker.SyncRequest(&msg); /* and echo it back to the user */ &xmlDoc = &response.getxmldoc(); MessageBox(0, "", 0, 0, &xmlDoc.genxmlstring());

    Note that this code assumes that the response from the server is properly formatted XML.

  2. In the PeopleSoft Pure Internet Architecture, open the node definition for TARGETNODE. Set the Connector ID to HTTPTARGET. Set the URL property value to the address of the HTTP server that will process the request.

  3. Open the EXAMPLE_PAGE page, and click on the Test button. The HTTP response will be displayed in the resulting message box.

Sending SOAP Messages in HTTP Requests

To send a SOAP message in an HTTP request:

  1. In PeopleSoft Application Designer, open the EXAMPLE_WORKREC record and add the following PeopleCode to the FieldChange event for the TEST field.

    &msg = CreateMessage(Operation.EXAMPLE_SERVICE_OPR); /* create a SOAP document */ &soapReq = CreateSOAPDoc(); &soapReq.AddMethod("TestNode", 1); &soapReq.AddParm("Text", "This is a SOAP request."); /* put the XML in the message */ &msg.setxmldoc(&soapReq.xmlDoc); /* send the request */ &response = %IntBroker.SyncRequest(&msg); /* and echo it back to the user */ &xmlDoc = &response.getxmldoc(); MessageBox(0, "", 0, 0, &xmlDoc.genxmlstring());

  2. In the PeopleSoft Pure Internet Architecture, open the node definition for TARGETNODE.

    1. On the Node Definitions-Connectors tab, set the Connector ID to HTTPTARGET.

    2. Set the URL property value to the address of the HTTP server that will process the request.

  3. Open the EXAMPLE_PAGE page, and click on the Test button. The HTTP response will be displayed in the resulting message box.

Click to jump to parent topicExample 3: Using the PeopleSoft 8.1 Connectors

The examples provided in this section demonstrate sending a rowset-based asynchronous message between a PeopleSoft 8.51 node and a PeopleSoft 8.1 node.

Click to jump to top of pageClick to jump to parent topicUnderstanding the PeopleSoft 8.1 Connectors Examples

When sending a message from a PeopleSoft 8.51 system to a PeopleSoft 8.1 system, you will use the PeopleSoft 8.1 target connector. You will also use PeopleCode, as well as the example page and work record that you created using the information in the setup section at the beginning of this appendix.

When sending a message from a PeopleSoft 8.1 system to a PeopleSoft 8.4 system, you will use the PeopleSoft 8.1 listening connector. You will also use the test message functionality in PeopleSoft Application Designer.

Click to jump to top of pageClick to jump to parent topicSetting Up Data for the PeopleSoft 8.1 Connectors Examples

This section describes setting up data for using the PeopleSoft 8.1 connector examples.

Setting Up Data on the PeopleSoft 8.51 System

To set up data on the PeopleSoft 8.51 system:

  1. In PeopleSoft Application Designer, create a new field called EXAMPLE_CHAR. This should be a mixed-case character field of size 20.

  2. Create a new record.

    1. Name the record EXAMPLE_REC.

    2. Add the EXAMPLE_CHAR field to this record, set it as the key, and save the definition.

    3. Build the physical table for this record.

  3. In the PeopleSoft Pure Internet Architecture, create a new message called EXAMPLE_PSFT_MSG with the version set to VERSION_1.

    1. Select the message type to be Rowset— Based.

    2. Add the EXAMPLE_REC record as the root record of this message.

  4. Add a new node, using the node name of the PeopleSoft 8.1 system. Verify that the Active Node box is checked, and save the record.

  5. Open the EXAMPLE_PAGE page and add an EditBox to the page, setting the following properties:

    Property

    Value

    Record name

    EXAMPLE_REC

    Field name

    EXAMPLE_CHAR

  6. Create a new service called PSFT81_SERVICE.

  7. Create a new service operation

    1. Add a service operation of type asynchronous-one way to the PSFT81_SERVICE and name it PSFT81_SERVICE_OPR.

    2. Add EXAMPLE_PSFT_MSG as the message.

    3. Add EXAMPLE_QUEUE as the queue.

    4. Configure the Service Operation Security for this service operation.

  8. Add an inbound routing for the PSFT81_SERVICE_OPR service operation with the sourcenode being the 8.1 system and the destination being the 8.51 system.

  9. Add an outbound routing for the PSFT81_SERVICE_OPR service operation with the sourcenode being the 8.51 system and the destination being 8.1 system.

  10. Open the EXAMPLE_WORKREC record. Add the following PeopleCode to the FieldChange event for the TEST field:

    &message = CreateMessage(Operation.PSFT81_SERVICE_OPR); /* get the buffer data */ &rowset = GetLevel0(); /* copy buffer data to the message */ &message.CopyRowset(&rowset); /* send the message */ &message.Publish();

  11. Go to the connector information for the new node. Set the Connector ID to PSFT81TARGET. Set the URL property to the address of the gateway servlet on the PeopleSoft 8.1 system. For example:

    http://<theServerNameAndPort>/servlets/gateway

Setting Up Data on the PeopleSoft 8.1 System

To set up data on the PeopleSoft 8.1 system:

  1. In PeopleSoft Application Designer, create a new field called EXAMPLE_CHAR. This should be a mixed-case character field of size 20.

  2. Create a new record.

    1. Name the record EXAMPLE_REC.

    2. Add the EXAMPLE_CHAR field to this record, set it as the key, and save the definition.

    3. Build the physical table for this record.

  3. Create a new message channel called EXAMPLE_CHANNEL. On the properties dialog box, set the Status to Run. Configure the security for the message monitor so that the channel can be displayed.

  4. Create a new message.

    1. Open the properties and select the Active box for the Status.

    2. Set the Message Channel to EXAMPLE_CHANNEL.

    3. Add the EXAMPLE_REC record to VERSION_1 of this message.

    4. Save the message as EXAMPLE_PSFT_MSG.

  5. Add the subscription ExampleSubscription to the EXAMPLE_PSFT_MSG. Use the following PeopleCode in the subscription body:

    /* get the incoming message */ &msg = GetMessage(); &msgXML = &msg.GenXMLString(); /* and write it to a file */ &file = GetFile("PSFT81msg.txt", "w"); &file.writeString(&msgXML); &file.close();

  6. Create a new message node, using the name of the PeopleSoft 8.51 node. Add a Location to this node with the following format:

    http://<serverName:port>/PSIGW/PS81ListeningConnector

    The serverName and port you specify must correspond to the integration gateway address of the PeopleSoft 8.51 system.

  7. Open the EXAMPLE_CHANNEL. Add a new routing rule to the channel, where the direction is Both and the message node name is that of the PeopleSoft 8.51 node.

  8. In the PeopleSoft Pure Internet Architecture, invoke the Gateway Administration servlet and add the PeopleSoft 8.1 node to the PeopleSoft handler.

  9. Open the Message Monitor and verify that the EXAMPLE_CHANNEL is running.

Click to jump to top of pageClick to jump to parent topicUsing the PeopleSoft 8.1 Target Connector

In the example presented in this section, you will use the PeopleSoft 8.1 target connector to send a message from a PeopleSoft 8.51 system to a PeopleSoft 8.1 system.

To send a message from a PeopleSoft 8.51 system to a PeopleSoft 8.1 system:

  1. In the PeopleSoft Pure Internet Architecture on the PeopleSoft 8.51 system, open the EXAMPLE_PAGE. Enter text into the edit box, and press the Test button. Wait for a minute or two to allow the systems to process the message.

  2. On the PeopleSoft 8.51 system, open Integration Broker Monitor to view the details of the outbound message.

  3. On the PeopleSoft 8.1 system, open up the Message Monitor to view the details of the received message. Open the PSFT81msg.txt file created by the subscription PeopleCode to see the body of the message.

Click to jump to top of pageClick to jump to parent topicUsing the PeopleSoft 8.1 Listening Connector

In the example presented in this section, you will use the PeopleSoft 8.1 listening connector to send a message from a PeopleSoft 8.1 system to a PeopleSoft 8.51 system.

To send a message from a PeopleSoft 8.1 system to a PeopleSoft 8.51 system:

  1. On the PeopleSoft 8.1 system, open PeopleSoft Application Designer and open the EXAMPLE_PSFT_MSG message. Right-click VERSION_1 and select Create test message. The Create Test Message window appears.

  2. Expand Transaction in the tester window. Set the value for EXAMPLE_CHAR. Open the PSCAMA section and set the AUDIT_ACTN to A and click OK. A message is published. Wait a minute or two before proceeding to allow the message to be processed by both nodes.

  3. On the PeopleSoft 8.1 system, open the Message Monitor to view the details of the outbound message.

  4. On the PeopleSoft 8.51 system, open the Service Operation Monitor to view the details of the received message.

Click to jump to parent topicExample 4: Using the JMS Connectors

This section discusses using the JMS listening and JMS target connectors.

Click to jump to top of pageClick to jump to parent topicUnderstanding the JMS Connector Examples

The examples in this section are intended to be generic and independent of the JMS provider being used. Because of this, in certain steps general instructions are provided. The actual details of the task will depend on the provider being used – and may be rather involved. Please refer to the appropriate documentation.

The error queue is not configured in the examples. However, configuring the error queue may be desirable should issues arise while trying the examples.

The examples in this section focus on queues, but the process for using the JMS connectors when working with topics is essentially the same.

See Also

Working With the JMS Connectors

Click to jump to top of pageClick to jump to parent topicPrerequisites

To use the examples in this section, a JMS provider must be configured and running. Please refer to the provider’s documentation for instructions on how to accomplish these tasks. Ensure that messages can be sent to topics and queues before proceeding with the examples.

For the JMS target connector example, you will need a utility to consume and view the messages created. For the JMS listening connector example, you will need a utility to create the messages. The exact details of these utilities depend on the provider. Some may provide an administrative console that you can use to view the contents of topics and queues, and possibly send new messages to them. Other providers may include sample Java programs that you can use to interact with the provider. Refer to the provider’s documentation for further details.

A special case exists for testing the JMS listening connector and queues when the provider is IBM MQSeries. In this instance, use Send Master to test the JMS listening connector.

See Also

Using JMS Projects

Click to jump to top of pageClick to jump to parent topicUsing the JMS Target Connector

In this example, PeopleSoft Integration Broker will generate a JMS message, which will be consumed outside of the PeopleSoft system.

To use the JMS target connector:

  1. On the JMS provider, create a JMS Connection Factory with the JNDI name ExampleConnectionFactory.

  2. On the JMS provider, create a JMS Queue with the JNDI name ExampleQueue.

  3. In PeopleSoft Application Designer, open the EXAMPLE_WORKREC record and add the following PeopleCode to the FieldChange event for the TEST field:

    /* create an XML document */ &xmldata = "<?xml version='1.0'?><ConnectorTest/>"; &xmlDoc = CreateXmlDoc(&xmldata); &rootNode = &xmlDoc.documentelement; /* add text to the document */ &descNode = &rootNode.AddElement("TestNode"); &descNode.NodeValue = "Sending a message to a JMS queue."; /* and send it out in an async request */ &MSG = CreateMessage(Operation.EXAMPLE_SERVICE_ASYNC_OPR); &MSG.SetXmlDoc(&xmlDoc); %IntBroker.Publish(&MSG); MessageBox(0, "", 0, 0, "Message sent.");

  4. In the PeopleSoft Pure Internet Architecture, open the node definition for TARGETNODE. Set the Connector ID to JMSTARGET. Set the values for the following properties:

    Property

    Value

    JMSFactory

    ExampleConnectionFactory.

    JMSProvider

    Name of the provider being used.

    JMSUrl

    Connection URL for the provider.

    JMSQueue

    ExampleQueue.

    JMSUserName

    The username on the JMS provider.

    JMSPassword

    The encrypted password for the user ID.

  5. Test the connector:

    1. Open the test page, and click on the Test button.

    2. Verify that the message was sent to the queue. The exact mechanism for doing depends on the provider or utility that you are using.

Click to jump to top of pageClick to jump to parent topicUsing the JMS Listening Connector

In this example, you will use the JMS listening connector to send a message to the JMS provider. PeopleSoft Integration Broker will consume the message.

To use the JMS listening connector:

  1. On the JMS provider, create a JMS Connection Factory with the JNDI name ExampleConnectionFactory.

  2. On the JMS provider, create a JMS Queue with the JNDI name ExampleQueue.

  3. In PeopleSoft Application Designer, create a application package and application class. In the application class, put the following PeopleCode in the OnRequest function

    Local XmlDoc &xmldoc; &xmldoc = &_MSG.GetXmlDoc(); /*&_msg is the parameter*/ /* and write it to a file */ Local File &theFile = GetFile("JMSRequest.txt", "W"); &theFile.WriteString(&xmldoc.GenXmlString()); &theFile.Close(); /* create the reponse message */ Local Message &outmsg; &outmsg = CreateMessage(Operation.EXAMPLE_SERVICE_OPR, %IntBroker_Response); /* build the body of the response */ Local string &xmldata = "<?xml version='1.0'?><ConnectorTest/>"; &xmldoc = CreateXmlDoc(&xmldata); Local XmlNode &rootNode = &xmldoc.DocumentElement; Local XmlNode &descNode = &rootNode.AddElement("ResponseMessage"); &descNode.NodeValue = "This wasgenerated in the OnRequest handler."; /* add the body to the message */ &outmsg.SetXmlDoc(&xmldoc); /* send the response message */ Return &outmsg;

  4. In PIA, open the handler tab on the service operation EXAMPLE_SERVICE_OPR, and set the application class package, class and method name as you defined above.

  5. In the integrationGateway.properties file, uncomment the following line:

    ig.jms.Queues=1

  6. Set the following properties to the values indicated:

    Property

    Value

    ig.jms.Queue1

    ExampleQueue

    ig.jms.Queue1.Provider

    <the name of the provider>

    ig.jms.Queue1.JMSFactory

    ExampleConnectionFactory

    ig.jms.Queue1.Url

    <connection URL for the provider>

    ig.jms.Queue1.Use

    < the userid >

    ig.jms.Queue1.Password

    <the encrypted password for the userid. >

    ig.jms.Queue1.MessageName

    EXAMPLE_SERVICE_OPR.VERSION_1

    ig.jms.Queue1.RequestingNode

    SOURCENODE

    ig.jms.Queue1.DestinationNode

    <the name of the local node >

  7. Deploy and start the JMSListeningConnectorAdministrator servlet.

    See Using the JMS Listening Connector.

  8. Test the connector:

    1. Send a text message to the example JMS queue. Set the text of the message to:

      <?xml version="1.0"?> <ConnectorTest> <TestNode>Sending a message to the JMS Listening Connector.</TestNode> </ConnectorTest>

    2. Check the message logs and the file named in the OnRequest method of application class . The message should be present in both.

Click to jump to parent topicExample 5: Using the AS2 Connectors

This section discusses using the AS2 listening and AS2 target connectors.

Click to jump to top of pageClick to jump to parent topicUnderstanding the AS2 Connector Examples

The purpose of the AS2 protocol is to allow the secure exchange of EDI data over the internet with trading partners. In the simplest case of an AS2 Message exchange, a sender packages data into an AS2 message structure and sends the message to trading partner over HTTP. Any kind of data can be transferred using AS2, including XML, EDI, text and binary.

This examples in this section demonstrate using the AS2 target connector to send an XML message to an external trading partner and using the AS2 listening connector to receive an XML message from a trading partner.

See Also

Working With the AS2 Connectors

Click to jump to top of pageClick to jump to parent topicPrerequisites

To use the examples in this section, security certificates must be setup and registered in the keystore on the source and target machines. Take note of the certificate alias name for both the source or signer and the target or recipient servers, as you will need this information to set connector properties.

Verify that messages can be sent to and received from the AS2 external trading partner over HTTP before proceeding with the examples.

For the AS2 target connector example, you will need a third-party application to consume and view the messages created. For the AS2 listening connector example, you will need a third-party application to create and deliver the messages.

See Also

Setting Up Secure Integration Environments

Click to jump to top of pageClick to jump to parent topicUsing the AS2 Target Connector

In this example PeopleSoft Integration Broker will generate an AS2 message and send it to a trading partner using HTTP. The external trading partner consumes the message. This example shows the tasks to perform to receive an MDN response message back synchronously or asynchronous.

To use the AS2 target connector:

  1. In PeopleSoft Application Designer open the EXAMPLE_WORKREC record and add the following PeopleCode to the FieldChange event for the TEST field:

    /*create an XML document */ Local string &xmldata; Local XmlDoc &xmlDoc; Local XmlNode &rootNode, &descNode; Local boolean &result; &xmldata = "<AS2ConnectorTest/>"; &xmlDoc = CreateXmlDoc(""); &rootNode = &xmlDoc.CreateDocumentElement("AS2ConnectorTest"); &rootNode = &xmlDoc.DocumentElement; /* add text to the document */ &descNode = &rootNode.AddElement("TestNode"); &descNode.NodeValue = "Sending a AS2 message."; &MSG = CreateMessage(Operation.EXAMPLE_SERVICE_ASYNC_OPR); &MSG.SetXmlDoc(&xmlDoc); /* and send it out in an async request */ %IntBroker.Publish(&MSG); MessageBox(0, "", 0, 0, "AS2 Message sent.");

  2. In the PeopleSoft Pure Internet Architecture, open the node definition for TARGETNODE. Set the Connector ID to AS2TARGET. Set the values for the following required properties:

    Property Name

    Value

    URL

    Specify the URL to which messages are sent using this connector.

    AS2To

    Specify the name of the sending node.

    AS2From

    Specify the name of the receiving node.

    RecipientCertAlias

    Specify the alias of the receiving certificate.

    SignersCertificateAlias

    Specify the alias of the signing certificate.

  3. Add an outbound asynchronous transaction on the AS2TARGETNODE, to identify that the message EXAMPLE_MESSAGE, VERSION_1 will be sent to the URL location.

  4. Set the following properties in the integrationGateway.properties file. Use PSCipher.bat utility located at <PIA_HOME>\webserv\peoplesoft to encrypt the keystore password.

    #AS2 Log Directory, logs all incoming and outgoing AS2 request and responses. #Uncomment and specify the correct directory name to enable logging. ​ig.AS2.LogDirectory = c://temp//as2 #AS2 Properties #Uncomment the following two lines to specify your keystore and AS2 properties ig.AS2.KeyStorePath=KeyStore Location (use // for windows path) ig.AS2.KeyStorePassword=EncryptedKeyStorePassword ig.AS2.AS2Directory=Location of AS2 Certificates (required for Async MDN Type) ig.AS2.LogDirectory=Path to store AS2 Log Files (optional) Examples ​ig.AS2.KeyStorePath=C://pt846-112-R2//webserv//peoplesoft//keystore//pskey ig.AS2.KeyStorePassword=GD9klUFw8760HVaqeT4pkg== ig.AS2.AS2Directory=c://temp//as2 ig.AS2.LogDirectory = c://temp//as2//logs ​

  5. If the MDN response is synchronous, go to step 8.

    If the MDN response is asynchronous, verify the delivered node named ASYNC_MDN exists.

  6. Verify that the node ASYNC_MDN has an active incoming asynchronous routing for the service operation ASYNC_MDN_RESPONSE. VERSION_1.

  7. Verify that the delivered queue AS2_CHANNEL is not in Pause mode.

  8. Test the connector.

    1. Open the test page, and click on the Test button.

    2. Verify that the message was sent to the recipient. The exact mechanism for doing so depends on the AS2 trading partner you are using.

    3. Verify that the MDN response was sent back to the source. The exact mechanism for doing so depends on the AS2 trading partner you are using.

  9. If the MDN type is set to Async, verify that the ASYNC_MDN_RESPONSE was received.

Click to jump to top of pageClick to jump to parent topicUsing the AS2 Listening Connector

In this example, you will use the AS2 listening connector to receive a message sent by the AS2 trading partner, and return an MDN synchronous or asynchronous response. Perform all tasks on the target machine. PeopleSoft Integration Broker will consume the message.

To use the AS2 listening connector:

  1. In the PeopleSoft Pure Internet Architecture, choose the node that corresponds to the AS2 trading partner sending the message.

  2. Insert an inbound asynchronous routing corresponding to the service operation EXAMPLE_REQUEST_ASYNC_OPR.VERSION_1 expected.

  3. Insert an outbound asynchronous routing corresponding to the service operation EXAMPLE_RESPONSE_ASYNC_OPR.VERSION_1 as a reply.

  4. In PeopleSoft Application Designer, create an application package and application class, and provide a method OnNotify with the following PeopleCode:

    Local XmlDoc &xmlDoc; Local File &theFile; Local Message &msg; Local XmlDoc &MsgXmlDoc, &xmlDoc; Local XmlNode &rootNode, &descNode; /* get the body of the incoming message */ &MsgXmlDoc = &MSG.GetXmlDoc(); /* and write it to a file */ &theFile = GetFile("AS2Request.txt", "W"); &theFile.WriteString(&MsgXmlDoc.GenXmlString()); &theFile.Close(); &xmlDoc = CreateXmlDoc(""); &rootNode = &xmlDoc.CreateDocumentElement("ConnectorTest"); &rootNode = &xmlDoc.DocumentElement; /* add text to the document */ &descNode = &rootNode.AddElement("ResponseMessage"); &descNode.NodeValue = "This was generated in the OnRequest event."; /* send the response message */ &msg = CreateMessage(Operation.EXAMPLE_RESPONSE_ASYNC_OPR); &msg.SetXmlDoc(&xmlDoc); /* and send it out in an async request */ %IntBroker.Publish(&msg);

  5. In PIA, open the handler tab on the service operation EXAMPLE_RESPONSE_ASYNC_OPR, and set the application package, class name and method.

  6. In the integrationGateway.properties file, set the following properties to the values indicated:

    #AS2 Properties #Uncomment the following two lines to specify your keystore and AS2 properties ig.AS2.KeyStorePath=KeyStore Location (use // for windows path) ig.AS2.KeyStorePassword=EncryptedKeyStorePassword ig.AS2.LogDirectory=Path to store AS2 Log Files (optional) #example: ​ig.AS2.KeyStorePath=C://pt846-112-R2//webserv//peoplesoft//keystore//pskey ig.AS2.KeyStorePassword=GD9klUFw8760HVaqeT4pkg== ig.AS2.LogDirectory = c://temp//as2//logs ​

    In the following required properties, replace the <SOURCENODE> with the name of the AS2 trading partner source node, and <TARGETNODE> with the name of the local target node. Continue to set the value of the property.

    # CertificateAlias is the certificate of AS2 Listening Node. # SignerCertificateAlias is the certificate of AS2 trading partner of Listening⇒ Node. ig.AS2.QE_<SOURCE>.<TARGET>.CertificateAlias= Target Machine Alias ig.AS2. <SOURCE>.<TARGET>.SignerCertificateAlias=Source Machine Alias #example: ​ig.AS2.PSFT_SRC_NODE.PSFT_TGT_NODE.CertificateAlias=<GeneratedAS2certificatealias> ig.AS2.PSFT_SRC_NODE.PSFT_TGT_NODE.SignerCertificateAlias=<Generated⇒ AS2certificatealias>

    The following values only need to be set if the incoming data does not contain the appropriate AS2To and AS2From values in the header of the message. It is best to leave these values in the request message header and leave these properties commented out.

    #This map translate AS2From and AS2To to a different node name. #This property is not required if you would use AS2FROM and AS2TO http header. ig.AS2.AS2ListenerMap.From.<SOURCEALIAS> = Specify the Source Node Name ig.AS2.AS2ListenerMap.To.<TARGETALIAS> = Specify the Target Node Name #example: ​ig.AS2.AS2ListenerMap.From.QE_SOURCE= PT_LOCAL ig.AS2.AS2ListenerMap.To. QE_IBTGT= AS2TARGETNODE ​

  7. Test the connector:

    1. Send a text message to the example AS2 queue. Name the message EXAMPLE_REQUEST_MSG.

    2. Set the text of the message to:

      <?xml version="1.0"?> <ConnectorTest> <TestNode>Sending a message to the AS2 Listening Connector.</TestNode> </ConnectorTest>

    3. Check the file named in the subscription PeopleCode. The default location for this file is <PS_CFG_HOME>\appserv\<DOMAIN_NAME>\Files. The message contents should be present.

    4. If the MDN type is asynchronous, verify that the AS2 trading partner received the ASYNC_MDN_RESPONSE.

Click to jump to parent topicExample 6: Using the Simple File Target Connector

This section describes how to use the simple file target connect to:

Click to jump to top of pageClick to jump to parent topicWriting PeopleSoft Data to Files

This section describes how to use the simple file target connector to write PeopleSoft data to a file.

To write data to a file:

  1. In PeopleSoft Application Designer, open the EXAMPLE_WORKREC record. Add the following PeopleCode to the FieldChange event for the TEST field:

    &msg = CreateMessage(Operation.EXAMPLE_SERVICE_OPR); &xmldata = "<?xml version='1.0'?><ConnectorTest/>"; /* create an XmlDoc */ &xmlDoc = CreateXmlDoc(&xmldata); &rootNode = &xmlDoc.documentelement; &descNode = &rootNode.AddElement("TestNode"); &descNode.NodeValue = "This message was written to a file."; /* put the XML in the request... */ &msg.setxmldoc(&xmlDoc); /* ...and send */ &response = %IntBroker.SyncRequest(&msg);

  2. In the PeopleSoft Pure Internet Architecture, open the node definition TARGETNODE.

    1. On the Node Definitions-Connectors tab, set the Connector ID to FILEOUTPUT.

    2. Add the following connector properties and values:

      Property

      Value

      Method

      PUT

      FilePath

      Enter the location where you want the connector to write the file. For example, c:\temp.

  3. Access the integrationGateway.properties file and comment out the following line.

    ig.fileconnector.password=EncryptedPassword

    The password option is not used in this example.

  4. In the PeopleSoft Pure Internet Architecture, open the EXAMPLE_PAGE page and click Test.

  5. Go to the directory specified in the connector properties, and open the new file. The contents should reflect what was created in the PeopleCode.

Click to jump to top of pageClick to jump to parent topicReading Data Into PeopleSoft From Files

This section describes how to use the simple file target connector to read data into PeopleSoft from files.

To read data from files into PeopleSoft:

  1. Create an XML file and include the following text:

    <?xml version='1.0'?> <ConnectorTest> <TestNode> The file has been read from the file system. </TestNode> </ConnectorTest>

  2. In PeopleSoft Application Designer, open the EXAMPLE_WORKREC record. Add the following PeopleCode to the FieldChange event for the TEST field:

    &msg = CreateMessage(Operation.EXAMPLE_SERVICE_OPR); &xmldata = "<?xml version='1.0'?><ConnectorTest/>"; /* create an XmlDoc */ &xmlDoc = CreateXmlDoc(&xmldata); /* put the XML in the message */ &msg.setxmldoc(&xmlDoc); /* send the request */ &response = %IntBroker.SyncRequest(&msg); /* display the results */ &xmlDoc = &response.getxmldoc(); MessageBox(0, "", 0, 0, &xmlDoc.genxmlstring());

  3. In the PeopleSoft Pure Internet Architecture, open the TARGETNODE node definition.

    1. Set the Connector ID to FILEOUTPUT.

      Set the FilePath property to the location from where the connector will read the output file.

    2. Add the following connector properties and values:

      Property

      Value

      FileName

      Specify the name of the output file. The file's default name has the following format: sourcenodename.serviceoperationname.publication_id.xml

      METHOD

      GET

  4. Access the integrationGateway.properties file and comment out the following line.

    ig.fileconnector.password=EncryptedPassword

    The password option is not used in this example.

  5. In the PeopleSoft Pure Internet Architecture, open the EXAMPLE_PAGE page and click the Test button.

    A message box appears that displays the data from the file read.

Click to jump to parent topicExample 7: Using the FTP Target Connector

This sections discusses how to use the FTP target connector to:

Click to jump to top of pageClick to jump to parent topicPrerequisites

For the examples presented in this section, you must have an active FTP server, as well as an account on that server.

Click to jump to top of pageClick to jump to parent topicUploading Files to FTP Servers

To upload a file to an FTP server:

  1. In PeopleSoft Application Designer, open the EXAMPLE_WORKREC record and add the following PeopleCode to the FieldChange event for the TEST field:

    &msg = CreateMessage(Operation.EXAMPLE_SERVICE_OPR); &xmldata = "<?xml version='1.0'?><ConnectorTest/>"; /* create an XmlDoc */ &xmlDoc = CreateXmlDoc(&xmldata); &rootNode = &xmlDoc.documentelement; &descNode = &rootNode.addelement("FTPtest"); &descNode.nodevalue = "This text will be uploaded"; /* put the XML in the message */ &msg.setxmldoc(&xmlDoc); /* send the request */ &response = %IntBroker.SyncRequest(&msg);

  2. In the PeopleSoft Pure Internet Architecture, open the TARGETNODE node definition.

    1. On the Node Definitions-Connectors tab, set the Connector ID to FTPTARGET.

    2. Set the following properties to the values indicated:

      Property

      Value

      HOSTNAME

      Specify the IP address or name of the FTP server for the connection.

      METHOD

      PUT

      USERNAME

      Enter the FTP server login ID.

      PASSWORD

      Enter the password for the login to the FTP server. This password must be encrypted. Use the Password Encryption Utility at the bottom of the page to encrypt the password, if necessary

  3. In the PeopleSoft Pure Internet Architecture, open the EXAMPLE_PAGE page and click the Test button.

    Login to the FTP server and check for the file. Open the file and verify the contents.

Click to jump to top of pageClick to jump to parent topicDownloading Files From FTP Servers

To download a file from an FTP server:

  1. Create an XML file with the following contents and place the file on an FTP server.

    <?xml version="1.0"?> <ConnectorTest> <TestNode>This message will be downloaded from an FTP server.</TestNode> </ConnectorTest>

  2. In PeopleSoft Application Designer, open the EXAMPLE_WORKREC record and add the following PeopleCode to the FieldChange event for the TEST field:

    &msg = CreateMessage(Operation.EXAMPLE_SERVICE_OPR); &xmldata = "<?xml version='1.0'?><ConnectorTest/>"; /* create an XmlDoc */ &xmlDoc = CreateXmlDoc(&xmldata); /* put the XML in the message */ &msg.setxmldoc(&xmlDoc); /* send the request */ &response = %IntBroker.SyncRequest(&msg); /* display the contents */ &xmlDoc = &response.getxmldoc(); MessageBox(0, "", 0, 0, &xmlDoc.genxmlstring());

  3. In the PeopleSoft Pure Internet Architecture, open the TARGETNODE node definition.

    1. On the Node Definitions-Connectors tab, set the Connector ID to FTPTARGET.

    2. Set the following properties to the values indicated:

      Property

      Value

      HOSTNAME

      Specify the IP address or name of the FTP server for the connection.

      METHOD

      GET

      FILENAME

      Specify the name of the file.

      USERNAME

      Enter the FTP server login ID.

      PASSWORD

      Enter the password for the login to the FTP server. This password must be encrypted. Use the Password Encryption Utility at the bottom of the page to encrypt the password, if necessary

  4. In the PeopleSoft Pure Internet Architecture, open the EXAMPLE_PAGE page and click the Test button.

    The contents of the XML file will display in the message box.

Click to jump to parent topicExample 8: Using the SMTP Target Connector

This section provides an example of how to use the Simple Mail Transfer Protocol (SMTP) target connector to send an email message using an SMTP server.

Click to jump to top of pageClick to jump to parent topicPrerequisites

For this example, you must have an active SMTP server as well as an active email account to receive the message.

Click to jump to top of pageClick to jump to parent topicSending Email Messages to SMTP Servers

To send an email message to an SMTP server using the SMTP target connector:

  1. In PeopleSoft Application Designer, open the EXAMPLE_WORKREC record and add the following PeopleCode to the FieldChange event for the TEST field:

    &msg = CreateMessage(Operation.EXAMPLE_SERVICE_OPR); &xmldata = "<?xml version='1.0'?><ConnectorTest/>"; /* create an XmlDoc */ &xmlDoc = CreateXmlDoc(&xmldata); &rootNode = &xmlDoc.documentelement; &descNode = &rootNode.addelement("SMTPtest"); &descNode.nodevalue = "This xml will appear in the email"; /* put the XML in the message */ &msg.setxmldoc(&xmlDoc); /* send the request */ &response = %IntBroker.SyncRequest(&msg);

  2. In the PeopleSoft Pure Internet Architecture, open the TARGETNODE node definition.

    1. On the Node Definitions-Connectors tab, set the Connector ID to SMTPTARGET.

    2. Set the following properties to the values indicated:

      Property

      Value

      DestEmailAddress

      Set this property to the email address to which the email will be sent.

      SourceEmailAddress

      Set this property to the email address from which you are sending the message.

  3. Access the integrationGateway.properties file. Locate the following line and replace <mailServerName> with the name of the SMTP server.

    ig.connector.smtptargetconnector.host=<mailServerName>

  4. In the PeopleSoft Pure Internet Architecture, open the EXAMPLE_PAGE page and click the Test button to send the message.

    Check the destination email account for the message. Since the message is being passed through one or more SMTP servers, there may be some propagation delay and the message might not be received immediately.