Hi All,
Requirement is : while sending the response back, VS should zip or compress the responseXML (which is very huge) and convert the compressed or zip file into byte message and send back the byte content of the zip file to the consumer application.
Transport protocol of the VS is MQ.
is this requirement doable in DevTest? if so. please suggest the approach.
Thanks,
Sumalatha
Yes, this is doable.
One way to do it, you need to add a “Scriptable Data Protocol” as the Response Side Dataprotocol
From the top of my head - meaning the below might not be correct at all – here is something mixed up from some zipping-a-string-stuff that I grabbed from StackOverflow. It could go something like this:
import com.itko.util.ParameterList;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.zip.GZIPOutputStream;
import java.util.zip.*;
// Get the response payload
String theBody = lisa_vse_response.getBodyText();
// Zip the response payload string
ByteArrayOutputStream out = new ByteArrayOutputStream();
GZIPOutputStream gzip = new GZIPOutputStream(out);
gzip.write(theBody.getBytes());
gzip.close();
// Set the response payload as binary
lisa_vse_response.setBodyBytes(out.toByteArray());
Hope this helps,
Cheers,
Danny