1 Reply Latest reply on Apr 20, 2020 1:11 AM by Andre Kirsten

    Getting Json output Token with java transformation Not working

    Falilou WAIDI Active Member

      Hi

      I am trying to get a token access  using  a java transformation in Developer.

      The output generated is empty and null value is returned.

      What is wrong with the attached code ?

       

      Accessing the token with Postann generates the folloowing request :

       

      Request Headers:

      Content-Type:"application/x-www-form-urlencoded"

      Authorization:"Basic XXXXFFFFF"

      Accept:"*/*"

      Cache-Control:"no-cache"

      Host:"myserver.com"

      Accept-Encoding:"gzip, deflate"

      Connection:"keep-alive"

       

      Request Body:

      Response Headers:

      Server:"Gateway"

      Connection:"close"

      X-CorrelationID:"jhkk:5 0"

      Accept:"*/*"

      Cache-Control:"no-cache"

      X-Forwarded-For:"111.11.11.11"

      Content-Type:"application/json"

       

      Thanks,

      Falilou

        • 1. Re: Getting Json output Token with java transformation Not working
          Andre Kirsten Guru

          Hi

           

          Please check the logs for any errors.

           

          For me, the easiest way to test this would be to copy the java code to an external IDE (e.g. Eclipse / Netbeans) and test the code there.

           

          Those IDEs are inherently better suited to debug any code related issues.
          Once the code works there, I move it to the Jave Tx in Developer and make the final small modifications (put import, helper functions etc into the expected tabs; remove debug output etc, once it works fine there as  well).


          If you want to track what is going on at a certain point of the Java Tx execution, you can use the logInfo() callable API in the code to write to the mapping log. Those messages can be located by searching for JTX_0012 in the log file.

           

           

          Kind regards,
          Andre.