Forum Discussion

francisbrochu's avatar
francisbrochu
Occasional Contributor
9 years ago

#RawResponse not working on open source version ?

Hi, is it possible that the following line works on SoapUI Pro only ? I tried the same on the open source version and my variable is empty.

 

def rawResponse = context.expand( '${REST Service#RawResponse}' )
  • If you using it in Script Assertion the following should work?

     

    log.info messageExchange.rawResponseData
  • nmrao's avatar
    nmrao
    Champion Level 3
    What exactly you want? Headers or just content of response?
  • nmrao's avatar
    nmrao
    Champion Level 3

    If you using it in Script Assertion the following should work?

     

    log.info messageExchange.rawResponseData
  • francisbrochu's avatar
    francisbrochu
    Occasional Contributor

    Well, I have a REST request who doesn't return JSON response. I can only know if it works by looking at HTTP 204 code. If it not works, I have a code 400. So, in Pro Version I was able to get all the raw response with the line I posted in my first message. It doesn't work in open source version.

     

    I tried your line, but I get the message : groovy.lang.MissingPropertyException No such property messageExchange for class.

     

    Do I have to import some libraries in order to work ?

  • francisbrochu's avatar
    francisbrochu
    Occasional Contributor

    Nevermind... I was using a Groovy Script step after my REST request. I didn't realize that I can add an script assertion directly in the REST request.

    • nmrao's avatar
      nmrao
      Champion Level 3
      So did the above line helped?