$done = true;
                 break;
             default:
                 sleep(5);
                 break;
         }
     } else {
         $done = true;
     }
 }
 if (isset($downloadFileReferenceId)) {
     $downloadFileRequest = new FileTransfer\Types\DownloadFileRequest();
     $downloadFileRequest->fileReferenceId = $downloadFileReferenceId;
     $downloadFileRequest->taskReferenceId = $createUploadJobResponse->jobId;
     print 'Downloading revise inventory status responses...';
     $downloadFileResponse = $transferService->downloadFile($downloadFileRequest);
     print "Done\n";
     if (isset($downloadFileResponse->errorMessage)) {
         foreach ($downloadFileResponse->errorMessage->error as $error) {
             printf("%s: %s\n\n", $error->severity === FileTransfer\Enums\ErrorSeverity::C_ERROR ? 'Error' : 'Warning', $error->message);
         }
     }
     if ($downloadFileResponse->ack !== 'Failure') {
         /**
          * Check that the response has an attachment.
          */
         if ($downloadFileResponse->hasAttachment()) {
             $attachment = $downloadFileResponse->attachment();
             /**
              * Save the attachment to file system's temporary directory.
              */
 /**
  * Get the values that will be passed to the File Transfer service.
  */
 $fileReferenceId = $response->FileReferenceID;
 $taskReferenceId = $response->TaskReferenceID;
 printf("FileReferenceID [%s] TaskReferenceID [%s]\n", $fileReferenceId, $taskReferenceId);
 print "Downloading file...\n";
 /**
  * An user token is required when using the File Transfer service.
  * Note that unlike the Trading service this token is not passed in via the request object.
  */
 $service = new FileTransfer\Services\FileTransferService(array('authToken' => $config['production']['userToken']));
 $request = new FileTransfer\Types\DownloadFileRequest();
 $request->fileReferenceId = $fileReferenceId;
 $request->taskReferenceId = $taskReferenceId;
 $response = $service->downloadFile($request);
 if (isset($response->errorMessage)) {
     foreach ($response->errorMessage->error as $error) {
         printf("%s: %s\n\n", $error->severity === FileTransfer\Enums\ErrorSeverity::C_ERROR ? 'Error' : 'Warning', $error->message);
     }
 }
 if ($response->ack !== 'Failure') {
     /**
      * Check that the response has an attachment.
      */
     if ($response->hasAttachment()) {
         $attachment = $response->attachment();
         /**
          * Save the attachment to file system's temporary directory.
          */
         $tempFilename = tempnam(sys_get_temp_dir(), 'category-specifics-') . '.zip';