Issue with Java Web Services in Passing Arguments to Java Program (388 Views)
Reply
Advisor
Bharath_Kumar
Posts: 45
Registered: ‎10-19-2011
Message 1 of 4 (388 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.

 

Advisor
TorstenNeumann
Posts: 14
Registered: ‎08-02-2011
Message 2 of 4 (325 Views)

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

Advisor
Bharath_Kumar
Posts: 45
Registered: ‎10-19-2011
Message 3 of 4 (314 Views)

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.

 

Honored Contributor
Utkarsh_Mishra
Posts: 713
Registered: ‎07-13-2010
Message 4 of 4 (310 Views)

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)
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.