Forum Discussion

chadmc_14686's avatar
chadmc_14686
Icon for Nimbostratus rankNimbostratus
Apr 03, 2007

download_configuration not transferring

Greetings,

 

 

I am having difficulty getting ITCMSystem.ConfigSync.download_configuration (v4.x iControl, Perl) to transfer the full ucs. Only 512 bytes are transferred, regardless of the size of the actual ucs. I've tried using download_file, with the same results. Scaling back chunk_size to 128, I can watch the progression up to 512, where it stops.

 

 

The targeted device is v4.6.4. I was only able to find one other topic referring to download_configuration for iControl v4.x, leaving me to believe that this is either not supported, or so incredibly simple that I should be embarassed for asking.

 

 

I've seen the v9.x examples, and have them working properly in my environment for those devices. Further, I have save_configuration working on the v4.6.4 devices.

 

 

I don't see any errors when I turn on SOAP::Lite + trace.

 

 

Thanks

 

1 Reply

  • Can you post the section of your code that does the download? I just tested this code from the 4.6.3 SDK against my 4.6.2 machine which worked fine.

     

     

    ----------------------------------------------------------------------------
     sub downloadConfiguration
    ----------------------------------------------------------------------------
    sub downloadConfiguration()
    {
      my ($configName, $localFile, $quiet) = (@_);
      $success = 0;
      if ( "" eq $localFile )
      {
        $localFile = $configName;
      }
      if ( "" eq $configName )
      {
        &usage("download");
      }
      open (LOCAL_FILE, ">$localFile") or die("Can't open $localFile for output: $!");
      binmode(LOCAL_FILE);
      my $file_offset = 0;
      my $chunk_size = $defaultChunkSize;
      my $chain_type = 0;
      my $bContinue = 1;
      while ( 1 == $bContinue )
      {
        $soap_response = $ConfigSync->download_configuration
        (
          SOAP::Data->name(config_name => $configName),
          SOAP::Data->name(chunk_size => $chunk_size),
          SOAP::Data->name(file_offset => $file_offset)
        );
        if ( $soap_response->fault )
        {
          if ( 1 != $quiet )
          {
            print $soap_response->faultcode, " ", $soap_response->faultstring, "\n";
          }
          $bContinue = 0;
        }
        else
        {
          $file_offset = $soap_response->result;
          @params = $soap_response->paramsout;
          $file_data = @params[0];
          $chain_type = @params[1];
           Append Data to File
          print LOCAL_FILE $file_data;
          if ( 1 != $quiet )
          {
            print "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\bBytes Transferred: $file_offset";
          }
          if ( ("FILE_LAST" eq $FileChainType->{$chain_type}) or
               ("FILE_FIRST_AND_LAST" eq $FileChainType->{$chain_type}) )
          {
            $bContinue = 0;
            $success = 1;
          }
        }
      }
      print "\n";
      close(LOCAL_FILE);
      return $success;
    }

     

     

    -Joe