Forum Discussion

alfonsolft's avatar
alfonsolft
Occasional Contributor
8 years ago

How could I transform a initial value to another value with code java in SOAPUI?

Hi

 

I have the answer of a REST service.  The following REST service uses as input an output of the first REST service parameter.  But the value needs to be calculated with a java progran . How could I do that?

 

java code to convert an initial value to another

 

import  xxxx.TOTPTokenGenerator;
public class Prueba {

    public static void main(String args[]) throws Exception {
    
 TOTPTokenGenerator generator = TOTPTokenGenerator.instancia();
 System.out.println(generator.getCode(args[0]));
      }
}

 

Thanks you

  • nmrao's avatar
    nmrao
    Champion Level 3
    Would you please elaborate a bit about your issue such that some one can understand and reproduce it to offer any kind of help. At the moment, the question is unclear.
    • alfonsolft's avatar
      alfonsolft
      Occasional Contributor
       
      Sorry for the bad description of what I want to do
       
      I have the following code grovy
       
       
      import  XXXXXX.totp.TOTPTokenGenerator;
      def token = ${#TestCase#token};===> How I put he input value from Propiedades, the before step?
      TOTPTokenGenerator generator = TOTPTokenGenerator.instancia();
      generator.getCode(token);==> How I put the output to the next steep?
       
       
      Thanks
       
       
      • nmrao's avatar
        nmrao
        Champion Level 3
        Please show the before step response.