Forum Discussion

vpnkumar's avatar
vpnkumar
Occasional Contributor
4 years ago

Unable to fetch Raw request for further changes in Soap Ui Pro

My Solution involves below steps

Load external Data Source

Create some dynamic properties using groovy and update them in properties container

In Rest request 1 update all the values either from external data source or properties container

BY using customized groovy which take updated Rest request, remove all the empty properties and make your request Json compatible

Set updated Raw request in rest request 1

Trigger rest Request1

 

Structure is this

 

I tried RequestFilter.filterRequest even in Rest request but it always return base request which do not have updated data value from data source/properties container

The problem is I am not able to get Raw request which is input of customized groovy for removing empty values.

 

Can some one please help me in how this can be achieved

  • vpnkumar :

     

    Have you tried with context :

     

    log.info "This is from events :: "+context.rawRequest

     

    Hope it will help you out. 

  • vpnkumar's avatar
    vpnkumar
    4 years ago

    Thanks Himanshu, along with the listed method this could be achieved using below code in RequestFilter.filterRequest event def requestContent = (String) context.getProperty(BaseHttpRequestTransport.REQUEST_CONTENT)
    log.info("Request Body BEFORE " + requestContent)

3 Replies

  • vpnkumar :

     

    Have you tried with context :

     

    log.info "This is from events :: "+context.rawRequest

     

    Hope it will help you out. 

    • vpnkumar's avatar
      vpnkumar
      Occasional Contributor

      Thanks Himanshu, along with the listed method this could be achieved using below code in RequestFilter.filterRequest event def requestContent = (String) context.getProperty(BaseHttpRequestTransport.REQUEST_CONTENT)
      log.info("Request Body BEFORE " + requestContent)

      • HimanshuTayal's avatar
        HimanshuTayal
        Community Hero

        Hi vpnkumar :

         

        Can you please mark this post as resolved so that it will help other help seekers 🙂