AnsweredAssumed Answered

using HTTP/S Live invocation to get remote content works, but the content is not sent to the original requestor..help!  -- working now

Question asked by sdetweil2 on Mar 9, 2016
Latest reply on May 11, 2016 by Melanie_Giuliani

I have this VSM (using DT 8.5.0) that has a few script steps, then executes an HTTP/S live invocation step  to pass the request on to the  original server.

 

I get the correct response from the server, and now let it fall thru to do the normal respond processing

 

script step 1

script step 2

http/s live invocation

prepare response

respond

the response at postman looks good, except no data

return code is 200 OK

the  headers come back properly

  • Access-Control-Allow-Headers →origin, content-type, accept
  • Access-Control-Allow-Methods →GET, POST, DELETE, PUT, PATCH, OPTIONS, HEAD
  • Access-Control-Allow-Origin →*
  • Cache-Control →no-store
  • Connection →keep-alive
  • Content-Encoding →gzip
  • Content-Length →10
  • Content-Type →application/json
  • Date →Wed, 09 Mar 2016 12:47:11 GMT
  • Pragma →no-cache
  • Server →nginx/1.8.0
  • X-xx-TransactionID →update1002
  • X-Powered-By →DevTest/8.5.0 (8.5.0.289); CA, Inc.

 

 

I removed the leading < to make this show

the response data from the Respond step looks like this

java.util.Arrays_-ArrayList>

  <a class="TransientResponse-array">

    <TransientResponse xmlns="http://www.ca.com/com/itko/lisa/vse/stateful/model/v1.0">

      <id>0</id>

      <binary>false</binary>

      <charset>UTF-8</charset>

      <metaData>

        <p key="HTTP-Response-Code">200</p>

        <p key="HTTP-Response-Code-Text">OK</p>

        <p key="Access-Control-Allow-Headers">origin, content-type, accept</p>

        <p key="Access-Control-Allow-Methods">GET, POST, DELETE, PUT, PATCH, OPTIONS, HEAD</p>

        <p key="Access-Control-Allow-Origin">*</p>

        <p key="Cache-Control">no-store</p>

        <p key="WasGzip">gzip</p>

        <p key="Content-Encoding">gzip</p>

        <p key="Content-Type">application/json</p>

        <p key="Date">Wed, 09 Mar 2016 12:47:11 GMT</p>

        <p key="Pragma">no-cache</p>

        <p key="Server">nginx/1.8.0</p>

        <p key="X-XX-TransactionID">update1002</p>

        <p key="Content-Length">169</p>

        <p key="Connection">keep-alive</p>

      </metaData>

      <body>

        <bodyAsString>{&quot;firstName&quot;:&quot;Tommy&quot;,&quot;lastName&quot;:&quot;Dreamer&quot;,&quot;displayName&quot;:&quot;John132&quot;,&quot;email&quot;:&quot;Test198@mailinator.com&quot;,&quot;title&quot;:&quot;AD&quot;,&quot;locale&quot;:&quot;en_US&quot;,&quot;username&quot;:&quot;Test198@mailinator.com&quot;,&quot;tivoliUuid&quot;:&quot;7798e011-2627-4601-8176-c6cb63de8bfc&quot;}</bodyAsString>

      </body>

      <unknown>false</unknown>

      <thinkTimeSpec>0</thinkTimeSpec>

    </TransientResponse>

  </a>

/java.util.Arrays_-ArrayList>

 

the only thing I could think of is the  Content-Encoding header

so I added a filter on the live inv step, to remove it, but my filter never executes..

process responses, use lisa.vse.response, this script is on both process tabs.. record and playback

 

%groovy%

import com.itko.util.ParameterList;

_logger.info("IN FILTER r")

// Metadata is a ParameterList

ParameterList metadata = lisa_vse_response.getMetaData();

String ce=metadata.getParameter("Content-Encoding")

 

 

_logger.info("filter has parm="+ce)

if(ce!=null && ce.equalsIgnoreCase("gzip"))

{

   _logger.info("removing")

    metadata.removeParameter("Content-Encoding")

    lisa_vse_response.setMetaData(metadata);

}

no log entry is recorded

Outcomes