This chapter discusses using the Simple Post utility to post third-party messages to integration gateways, and discusses how to:
Access the Simple Post utility.
Use the Simple Post class.
Use the Simple Post utility using a Java API.
Post third-party XML messages to the integration gateway.
Ping remote nodes.
Increase the Java heap size to accommodate posting large files.
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.
This section describes the prerequisites for using the Simple Post utility.
To use the utility you must have the Java Runtime Environment (JRE) installed.
To use the Simple Post utility, must perform one of the following actions:
Modify the CLASSPATH to include the location of the Simple Post utility.
Pass the location of the PeopleSoft classes when you call the Simple Post class.
For example:
java -cp "<PIA_HOME>\webserv\<DOMAIN>\applications\peoplesoft\PSIGW.war\ WEB-INF\classes" com.peoplesoft.pt.simplepost.SimplePost ...
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.
This section provides an overview of the Simple Post class, including its:
Usage
Syntax
Parameters
The standard usage of the Simple Post class is:
com.peoplesoft.pt.simplepost.SimplePost [-options]
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.
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:
|
-msgtype |
(Optional.) Identifies the message type. Values are:
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. |
(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:
|
-h |
(Optional.) Specifies an HTTP header. For example:
There can be one:many –h parameter invocations. For example:
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. |
You can use the Simple Post utility using a Java API.
This section provides code examples that demonstrate how to:
Construct a Java file containing Simple Post parameters.
Compile the Java file.
Run the test program.
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.52 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()); } } }
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.52\webserv\ps\applications\peoplesoft\PSIGW.war\ WEB-INF\classes;." TestSimplePost.java
The following example shows how to invoke the test program.
java -classpath "C:\PT8.52\webserv\ps\applications\peoplesoft\PSIGW.war\ WEB-INF\classes;." TestSimplePost
This section discusses how to use the Simple Post utility to post XML messages from third-party systems to the integration gateway.
To post a third-party XML message to the integration gateway:
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.
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:
-reqnode
-opername
-url
-infile
-outfile
Press ENTER.
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
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>
This section provides an overview of increasing the Java heap size, and describes how to:
Increase the Java heap size on Oracle WebLogic web servers.
Increase the Java heap size on IBM WebSphere web servers.
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.
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:
Use a text editor to open the setenv.cmd file.
The file is located via the following path: <PIA_HOME>\webserv\peoplesoft\bin.
Locate the SET JAVA_OPTIONS parameter.
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
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
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:
Stop and restart the web server using the following commands:
Stop the web server: WAS_HOME/bin> stopServer.bat(sh) <serverName>
Start the web server: WAS_HOME/bin> startServer.bat(sh) <serverName>
Open the Admin console at http://<machine-name>:9090/admin, where 9090 refers to the default Admin console port.
Log in to the system as any user.
Expand Servers, Application Servers, server, Process Definition, Java Virtual Machine.
Enter values for Initial Heap and Max Heap.
Save the configuration and log out.
Restart the web server.