Forum Discussion

Rakesh15's avatar
Rakesh15
Occasional Contributor
5 years ago

Blank JDBC response when saved to a file

The JDBC results are blank when saved in SOAP/REST UI 5.5. The result set has only is 1 or 2 lines

Looking for solutions.

6 Replies

  • ChrisAdams's avatar
    ChrisAdams
    Super Contributor

    HI,

     

    Would you like to provide some more details about what you are trying to achieve and what you expect to happen.  Screenshots would be really helpful too.

    • Rakesh15's avatar
      Rakesh15
      Occasional Contributor

      Step 1: I am able to fetch the results using JDBC query

      Step 2: Able to export the file to local machine

      Step3. My file is blank with no data

       

      Below is the snippet I am using 

      def ReqFile ="C:/Test/ReqFile1.xml"
      def Req = context.expand( '${JDBC#Request}' )
      def i = new File(ReqFile )
      i.write(Req, "UTF-8")


      def ResFile ="C:/Test/Response1.xml"
      def Res = context.expand( '${JDBC#Response}' )
      def j = new File(ResFile)
      j.write(Res, "UTF-8")

       

      Below is the JDBC request and output

      Note: Important I need the Results/Response set to be stored in local

      • ChrisAdams's avatar
        ChrisAdams
        Super Contributor

        Hi,

         

        That's much clearer, thank you.  I understand what you're after now.

         

        I don't have the means to test until Monday, but in the meantime, have you tried reporting the request and response of Rest/Soap web service call?  If your Groovy works with one of those steps, then maybe there is something different about the JDBC step.