Compress services
Use Compress services to compress the data before sending the HTTP request and decompress it after receiving the HTTP response.
compressData
Compresses the data that uses one of the specified compression schemes before sending the HTTP request.
- Input parameters
-
- data-Document
- Specify the data to be compressed that uses one or more of these keys- string, bytes, or stream. If multiple keys are provided, webMethods Integration processes them in the following order: string first, bytes second, and stream last. The service uses the first key it encounters.
- string-String
- Text that you want the compressData service to compress.
- bytes-byte[]
- Data that you want the compressData service to compress.
- stream-java.io.InputStream
- Data that you want the compressData service to compress.
- encoding-String
- The name of a registered IANA character set that defines the encoding used to convert the String
into a byte array. For example,
ISO-8859-1. - compression Scheme-String
- The compression method you want the compressData service to apply to
compress the data. The supported compression schemes are
gzipanddeflate. - loadAs-String
- Form in which you want the compressData service to store the output data.
Set to
bytesto store the data as abyte[]andstreamto store the data as ajava.io.InputStream.
- Output parameters
-
- compressedData-Document
- Compressed data after applying the compression scheme.
- bytes-byte[] Conditional
- The compressed data is returned as a
byte[ ], but only when the loadAs input parameter is set tobytes. - stream-java.io.InputStream Conditional
- The compressed data is returned as an InputStream, but only when the
loadAs input parameter is set to
stream.
decompressData
Decompresses the data based on the response header of the HTTP response.
- Input parameters
-
- data-Document
- Specify the data you want the
decompressDataservice to decompress using one of the following options:bytes.byte[]. Provide the data as a byte array.stream.java.io.InputStream. Provide the data as an input stream.
- compressionScheme-String
- The compression scheme you want the decompressData service to apply to
decompress the data. The supported compression schemes are
gzipanddeflate. - loadAs-String
- Specify the format in which the decompressData service should return the
decompressed document. Set to
bytesto receive abyte[]orstreamto receive a java.io.InputStream.
- Output parameters
-
- decompressedData-Document
- The data obtained after applying the compression algorithm.
- bytes-byte[] Conditional
- Decompressed data represented as a
byte[]. This format is returned only when the loadAs input parameter is set tobytes. - stream-java.io.InputStream-Conditional
- Decompressed data represented as an InputStream. This format is returned only when the loadAs input parameter is set to stream.