Using the PeopleSoft Target Connector

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

  • Set up data on the originating system.

  • Set up data on the destination system.

  • Test the PeopleSoft target connector.

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 the PeopleSoft Pure Internet Architecture, 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 the 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", "UTF8");
       &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 Operations 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.