Forum Discussion

Kimdoengart's avatar
Kimdoengart
New Contributor
10 months ago
Solved

Get soap response content

Hi. 

 

Is there any way to make this code snippet applie to soap and not rest. 

def content = context.httpResponse.responseContent
content = content.replaceAll( "<!\\[CDATA\\[", "" )
content = content.replaceAll( "]]>", "" )

log.info( content )

context.httpResponse.responseContent = content
  • Kimdoengart 

    Yes. It is possible to find that.

    I believe that the above code snippet is of script assertion of the Soap Request type test step, but not Groovy Script test step.

     

    Here it goes:

     

    import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep
    if (context.currentStep instanceof WsdlTestRequestStep) {
     //Your code goes inside of this if block
    
    }

     

     

3 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3

    Kimdoengart 

    Yes. It is possible to find that.

    I believe that the above code snippet is of script assertion of the Soap Request type test step, but not Groovy Script test step.

     

    Here it goes:

     

    import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep
    if (context.currentStep instanceof WsdlTestRequestStep) {
     //Your code goes inside of this if block
    
    }