Sunday, October 20, 2013

Component Interface to Java API

Component Interface to Java API



CI to Java Interface


In this example we will see that how a Component Interface developed in PeopleSoft system can be used in other languages. Here, we have showed it for Java API's.

Once the CI development is completed, then first build the API's.




Select the API's to Build.







All the Java API’s will be generated under C:\Deepak\javaprograms\PeopleSoft\Generated\CompIntfc

Once the API's are built, generate the Java Template.






Place this file D91_USERPRFL_CI.java under - C:\Deepak\javaprograms\src

Folder Structure




Set the classpath environment variable to -

C:\PT8.50\web\psjoa\psjoa.jar;C:\pt8.50\class;C:\Deepak\javaprograms\class

Compile the java API’s



Navigate to the folder where all the java api’s are stored.




Compile the java API’s and place all the class files under C:\Deepak\javaprograms\class

Javac –d C:\Deepak\javaprograms\class *.java




Compile the java template

Before compiling, modify the java template to create a package –




javac -d C:\Deepak\javaprograms\class D91_USERPRFL_CI.java

The java template file will be generated under the package DKR_JavaPrograms

Now run the java template file.

C:\Deepak\javaprograms\src>java src.DKR_JavaPrograms.D91_USERPRFL_CI




Enter Application Server Machine Name: 192.168.88.130
Enter Application Server Port Number: 9000
Enter PeopleSoft UserID: PS
Enter PeopleSoft UserID Password: PS

Enter Oprid: PS



And here we get the output.



Compiling and Running in Eclipse

First, create a new project.










Click Apply and OK




Click on Libraries and the psjoa.jar file from PS_HOME/web/psjoa/psjoa.jar




Click Add External JAR’s




Click on Finish.


Build the API’s
 






Now, refresh the project folder.










Now, open the class and copy it into the above modified java template.

The only change is the change in the package.




Now, run this program.







And, here we get the output.

No comments:

Post a Comment