Bharath_Kumar Absent Member.
Absent Member.
899 views

Issue with Java Web Services in Passing Arguments to Java Program

Issue with Java Web Services in Passing Arguments from PPM to Java Program to consume Web Service operations.

 

We have build code to save PPM record via web services, however currently facing issues in getting Argument list from PPM to Java program.

 

The Java program is executed via a Command in Report and the Arguments are being passed in command line. the issue we are currently facing is that hte Argument when checked at PPM end show values, however when received at Java end shows NULL.

 

Tags (1)
0 Likes
3 Replies
TorstenNeumann Absent Member.
Absent Member.

Re: Issue with Java Web Services in Passing Arguments to Java Program

...please provide more information (e.g. code snippet).

 

Currently the error description is too generic to be able to help.

 

Best regards,

Torsten

0 Likes
Bharath_Kumar Absent Member.
Absent Member.

Re: Issue with Java Web Services in Passing Arguments to Java Program

Hi Team,

 

We have configured this command in a Report config to call the Java program SampleWSSave

 

java -Dclient.repository.dir=XXX -classpath yyy SampleWSSave "[AS.JDBC_URL]" "[AS.DB_USERNAME]" "[AS.BASE_PATH]"

 

and the code has this format

 

public class SampleWSSave {

public static void main(String[] argmnts){

 

however the Logs show that the 3 parameters (argmnts[0], argmnts[1], argmnts[2]) being passed show values NULL, in LOGS and thus the code is not working as intended.

 

Please help on what could be the possible issue not getting the values on to the Parameter list.

 

0 Likes
Established Member.. Utkarsh_Mishra
Established Member..

Re: Issue with Java Web Services in Passing Arguments to Java Program

Its better to put this command in .batch or .sh file and then call it from PPM command.

 

Take reference of run_client.bat which is provide by HP web service toolkit.

 

java -classpath %CPATH% -Dclient.repository.dir=%WSCLIENT_HOME% %*

 Check the * at the end of command, this is used to pass parameter from PPM to your java code.

 

So your PPM command will look like (if batch file name is run_example.bat and make sure to give absoulte path)

 

ksc_local_exec c:/ppm/web_service/run_example.bat com.example.SampleWSSave "[AS.JDBC_URL]" "[AS.DB_USERNAME]" "[AS.BASE_PATH]"

 

The above code is working for me and we never faced any issue while passing the paramters.

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.