Using the Simple Post Utility

This chapter discusses using the Simple Post utility to post third-party messages to integration gateways, and discusses how to:

Click to jump to parent topicUnderstanding the Simple Post Utility

The Simple Post utility enables you to use shell scripts or a Java API to post XML messages from third-party systems to the integration gateway. The utility wraps the incoming messages in the PeopleSoft XML wrapper format and posts them to the HTTP listening connector.

The Simple Post utility reads ASCII, UTF-8 and UTF-16 file formats for incoming messages and converts them to UTF-8 to send to the integration gateway.

Click to jump to parent topicPrerequisites

This section describes the prerequisites for using the Simple Post utility.

Click to jump to top of pageClick to jump to parent topicSoftware Requirements

To use the utility you must have the Java Runtime Environment (JRE) installed.

Click to jump to top of pageClick to jump to parent topicSetting Environment Variables

To use the Simple Post utility, must perform one of the following actions:

Click to jump to parent topicAccessing the Simple Post Class

The Simple Post utility is a Java class with the package name com.peoplesoft.pt.simplepost.SimplePost.

The location of the utility is in the PeopleSoft web server domain under: \applications\peoplesoft\PSIGW.war\WEB-INF\classes\com\peoplesoft\pt\simplepost.

Click to jump to parent topicUsing the Simple Post Class

This section provides an overview of the Simple Post class, including its:

Click to jump to top of pageClick to jump to parent topicUsage

The standard usage of the Simple Post class is:

com.peoplesoft.pt.simplepost.SimplePost [-options]

Click to jump to top of pageClick to jump to parent topicSyntax

The syntax for sending an XML message from a third-party system to the integration gateway is:

com.peoplesoft.pt.simplepost.SimplePost ​-reqnode <requesting node> ​-opername <service operation.version> ​-url <destination server URL. This is always the HTTP listening connector> ​-infile <input file name and path> ​-outfile <output file name and path> ​-opertype <operation type> ​-destnode <destination node name(s)> ​-v ​<Display debugging output> −to ​ <timeout value> -?-help <Display help>

Note that you enter the syntax as a single line.

Click to jump to top of pageClick to jump to parent topicParameters

The Simple Post utility parameters that you can pass are described in the following table.

Parameter

Description

-reqnode

Identifies the requesting node name.

-opername

Identifies the service operation and service operation version that you are sending.

For example: ADD_PO.v1

-msgname

Identifies the name of the message that you are sending.

This parameter is not used in PeopleTools 8.48 and higher releases.

-url

Identifies the destination server URL.

-infile

Identifies the path and file name to send.

The root node must be name of the message. For example, if the name of the message is SYNC_TEST, the root node of the XML input file must be <SYNC_TEST>.

-outfile

Identifies the path and filename where the utility generates the response from the server.

-opertype

(Optional.) Identifies the service operation type. Values are:

  • sync: The service operation is synchronous.

  • async: The service operation is asynchronous.

  • ping: Tests the application server to make sure it is available and accepting requests.

-msgtype

(Optional.) Identifies the message type. Values are:

  • sync: The message is synchronous.

  • async: The message is asynchronous.

  • ping: Tests the application server to make sure it is available and accepting requests.

This parameter is not used in PeopleTools 8.48 and higher releases.

-msgver

(Optional.) Identifies the version number to apply to the message.

For example, VERSION_1.

This parameter is not used in PeopleTools 8.48 and higher releases.

-destnode

(Optional.) Identifies the destination node name.

-v

(Optional.) Displays any debugging output.

-en

(Optional.) Compresses and base64-encodes the data.

When this command line option is located on the Simple Post call, the logic compresses and base64-encodes the data, places it into the Data node, and then adds the required headers into the request.

-to

(Optional.) Identifies the timeout value.

This integer value determines the amount of time, in seconds, that the Simple Post class will wait for a response from the server.

-pwd

(Optional.) Identifies the password for the destination node.

This parameter is optional, unless the destination node requires a password.

-ou

(Optional.) Identifies the ID of the originating user.

-on

(Optional.) Identifies the name of the originating node.

-op

(Optional.) Identifies the name of the originating process.

-sq

(Optional.) Identifies the subqueue.

-sc

(Optional.) Identifies the subchannel.

This parameter is not used in PeopleTools 8.48 and higher releases.

-fdn

(Optional.) Identifies the name of the final destination node.

-emid

(Optional.) Applies a unique external message ID to a message to ensure no duplicate messages are sent to PeopleSoft Integration Broker.

The ID cannot exceed 70 characters.

-nr

(Optional.) Specifies whether to turn on nonrepudiation. The valid values are:

  • Y: Turn on nonrepudiation.

  • N: Turn off nonrepudiation. (Default)

-h

(Optional.) Specifies an HTTP header.

For example:

SOAPAction: QE_SYNC_MSG.v1

There can be one:many –h parameter invocations. For example:

com.peoplesoft.pt.simplepost.SimplePost -reqnode⇒ QE_UNDERDOG -opername QE_SYNC_MSG.v1 -url "http:⇒ //jfranco040303/PSIGW/HttpListeningConnector" -⇒ infile "C:UserMy DocumentsQE_SYNC_MSGQE_SYNC_⇒ MSG.xml" -outfile "C:Documents and Settings⇒ Desktopout.txt" ​-h "SOAPAction: QE_SYNC_MSG.v1" ​-h⇒ "test2:Joe_User"

Note. When Simple Post encounters an HTTP header name of SOAPAction, the content of the input file is not wrapped into IBRequest XML format and no IBInfo data is built. The IBInfo data, such as service operation name, requesting node, requesting node password, destination node, and so on, can be pulled from the SOAPAction field.

-?-help

(Optional.) Displays a list of the Simple Post utility parameters.

Click to jump to parent topicUsing the Simple Post Utility Using a Java API

You can use the Simple Post utility using a Java API.

This section provides code examples that demonstrate how to:

Click to jump to top of pageClick to jump to parent topicConstructing a Java File Containing Simple Post Parameters

The following example shows a submission via a Java API:

// Import the SimplePost API import com.peoplesoft.pt.simplepost.SimplePost; /** Test class to use SimplePost functionality */ public class TestSimplePost { /** Constructor */ public TestSimplePost() {} public static void main (String argv []) { // Create the SimplePost object SimplePost mainSPObj = new SimplePost(); // Turn on printouts mainSPObj.setVerbose(true); // Use this function to see the output stream, // defaulted to System.out // mainSPObj.setOutputPrintStream(<PrintStream>); // Turn on Encoding for 8.51 mainSPObj.setEncoding(true); // ​SET THE REQUIRED DATA // Requesting Node ​mainSPObj.setRequestingNode("QE_UNDERDOG"); // Operation Name ​mainSPObj.setMessageName("QE_SYNC_MSG.v1"); // Server URL, must be the HttpListeningConnector or a //connector that can accept an IBRequest XML message ​mainSPObj.setServerURL("http://localhost/PSIGW/ HttpListeningConnector"); // Input file name, root node name must be the name of the message ​mainSPObj.setInputFileName("c:\\temp\\ QE_SYNC_MSG.xml"); /* // Optional data mainSPObj.setMessageType(MESSAGE_TYPE_SYNC); mainSPObj.setDestinationNode("QE_LOCAL"); mainSPObj.setTimeOut(2.5); mainSPObj.setPassword(""); mainSPObj.setOriginatingUser(""); mainSPObj.setOriginatingNode(""); mainSPObj.setOriginatingProcess(""); mainSPObj.setSubChannel(""); mainSPObj.setFinalDestinationNode(""); */ // Post the data boolean returnValue = mainSPObj.post(); // Check the return value if (!returnValue) { // False, printout the error message System.out.println(mainSPObj.getMessage()); } else { // Success! // Printout the return code and server message System.out.println("\n" + mainSPObj.getResponseCode() + " - " + mainSPObj.getResponseMessage()); // Printout the headers System.out.print("\n" + mainSPObj.getResponseHeaders() + "\n"); // Printout the data System.out.print("\n" + mainSPObj.getResponseData()); } } }

Click to jump to top of pageClick to jump to parent topicCompiling the Java File

The following example shows a command line for compiling the Java file. In this example, the Java file name is TestSimplePost.java:

javac -classpath "C:\PT8.51\webserv\ps\applications\peoplesoft\PSIGW.war\ WEB-INF\classes;." ​TestSimplePost.java

Click to jump to top of pageClick to jump to parent topicRunning the Test Program

The following example shows how to invoke the test program.

java -classpath "C:\PT8.51\webserv\ps\applications\peoplesoft\PSIGW.war\WEB-INF⇒ \classes;." TestSimplePost

Click to jump to parent topicPosting Third-Party XML Messages to the Integration Gateway

This section discusses how to use the Simple Post utility to post XML messages from third-party systems to the integration gateway.

Click to jump to top of pageClick to jump to parent topicPosting XML Messages to the Integration Gateway

To post a third-party XML message to the integration gateway:

  1. Access the Simple Post utility.

    In the Windows environment, open a Windows command prompt, and then navigate to the utility as described earlier in this section.

    In the UNIX environment, open a terminal window or shell window, and then navigate to the utility location, as described earlier in this section.

  2. Enter the following command, followed by parameter name and value pairs.

    java com.peoplesoft.pt.simplepost.SimplePost

    You must enter parameter name and value pairs for:

  3. Press ENTER.

Click to jump to top of pageClick to jump to parent topicSimple Post Submission Examples

The following is a Windows-based submission example:

java com.peoplesoft.pt.simplepost.SimplePost ​-reqnode KACNODE ​-opername QE_F18_ASYNC.v1 ​-url ​ http://intgateway01/PSIGW/HttpListeningConnector ​-infile ​ C:\temp\QE_F18_ASYNC.xml ​-outfile C:\temp\out.xml ​ -opertype async ​-destnode ​UNDERDOG ​-v

The following is a UNIX-based submission example:

java com.peoplesoft.pt.simplepost.SimplePost ​-reqnode KACNODE ​-opername QE_F18_ASYNC ​-url http://intgateway01/PSIGW/HttpListeningConnector ​-infile /temp/QE_F18_ASYNC.xml ​-outfile /temp/out.xml ​-opertype async ​ -destnode UNDERDOG ​-v

Click to jump to parent topicPinging Remote Nodes

You can use the Simple Post utility to ping remote nodes. The following is an example of a Simple Post command line ping. Notice that -msgtype parameter is set to ping:

java com.peoplesoft.pt.simplepost.SimplePost -reqnode JRHOME ​-opername JR_COUNTRY_MSG ​-infile c:\temp\pingin.xml ​-outfile c:\temp\pingout.txt ​-opertype ping ​-url http://jrunstad040102/PSIGW/HttpListeningConnector

This example is the result of a successful ping, pingout.txt:

<?xml version="1.0"?> <IBResponse type = "success"> <DefaultTitle>Integration Broker Response</DefaultTitle> <StatusCode>0</StatusCode> <TransactionID>null</TransactionID> </IBResponse>

Click to jump to parent topicIncreasing the Java Heap Size to Accommodate Posting Large Files

This section provides an overview of increasing the Java heap size, and describes how to:

Click to jump to top of pageClick to jump to parent topicUnderstanding Increasing the Java Heap Size

When posting files that are five megabytes (MB) or larger to the integration gateway, you should increase the Java heap size in the Simple Post Utility to handle larger file sizes. If the Simple Post Utility does not have enough memory for a task, the system might generate an “Out of Memory” error.

You can increase the heap size to any value that you want, as long as your machine has the random access memory (RAM) to support the value that you choose.

The steps to increase the JVM heap size depend on the web server.

Click to jump to top of pageClick to jump to parent topicIncreasing the Java Heap Size on Oracle WebLogic Web Servers

When using an Oracle WebLogic web server, you increase the JVM heap size in the setenv.cmd file.

To increase the Java heap size on an Oracle WebLogic web server:

  1. Use a text editor to open the setenv.cmd file.

    The file is located via the following path: <PIA_HOME>\webserv\peoplesoft\bin.

  2. Locate the SET JAVA_OPTIONS parameter.

  3. Change or add the –XmxZZm parameter, where ZZ equals the amount of RAM, in MB, to allocate.

    The following example shows the parameter set to a maximum of 128 MB.

    SET JAVA_OPTIONS=-hotspot -ms1m -mx128m

  4. Save the changes.

When you run the Simple Post utility, you must specify the maximum Java heap size that you specified here. For example, if you set the JAVA_OPTIONS parameter in the setenv.cmd file to 128 MB, when invoking the Simple Post utility you must add the following argument to the command line:

-Xmx128m

Click to jump to top of pageClick to jump to parent topicIncreasing the Java Heap Size on IBM WebSphere Web Servers

If your web server is an IBM WebSphere server, the JVM heap size is most likely set to a minimum heap size of 64 MB and a maximum size of 256 MB. Setting the JVM heap size to a larger minimum value (preferably one that equals the maximum value) avoids a compromise in performance incurred by dynamically growing the JVM and improves predictability; it also reduces the frequency for JVM garbage collection.

PeopleSoft recommends that if you use IBM WebSphere, you increase the JVM minimum heap size to 256 MB.

To increase the Java heap size on an IBM WebSphere web server:

  1. Stop and restart the web server using the following commands:

  2. Open the Admin console at http://<machine-name>:9090/admin, where 9090 refers to the default Admin console port.

  3. Log in to the system as any user.

  4. Expand Servers, Application Servers, server, Process Definition, Java Virtual Machine.

  5. Enter values for Initial Heap and Max Heap.

  6. Save the configuration and log out.

  7. Restart the web server.