Request and response formats

The QuickBooks Online Java SDK supports serialization of requests and responses to XML and JSON formats, and compression of data to Gzip and Deflate formats. This collectively helps in reducing the size of request and response messages exchanged across networks, which in turn improves the performance of service calls (both sync and async) to QuickBooks Online. For more information, see Making calls with the REST API.

The SDK allows you to set the serialization and compression format in the configuration file. If the custom configuration is not defined, the SDK uses the default values to serialize and compress the request and response data.

The following section describes steps to set custom serialization and data compression in the configuration file. Customizations to serialization and data compression are made in the configuration file, intuit-config.xml. Create this file in your app project if it doesn’t already exist.

Configure request and response formats

You can define either the compression or serialization value alone and let the SDK use the default value for the undefined feature. Using the intuit-config tag and leaving the compression value as blank leaves the data uncompressed. Include the following code to set serialization format of requests and responses to XML and compression to gzip:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
<intuit-config>
   <message>
      <request>
         <compression>gzip</compression>
         <serialization>xml</serialization>
      </request>
      <response>
         <compression>gzip</compression>
         <serialization>xml</serialization>
      </response>
   </message>
</intuit-config>

Note

Note

For steps to override custom configuration and default settings, see Configuration.