3

I'm writing a java client for the Import Export Service. It basically works fine: I'm able to export a package and download it as a zip file, upload that to another Tridion instance and import it.

The problem is with the 'unhappy flow'. If the package cannot be imported for some reason, all that the Import Export Service tells me is that the import has been aborted. When I try to download the log file (which is another nice feature of the IE Service), I get an error.

Here is my code:

File f = new File(packageName);
byte[] data;
data = getBytesFromFile(f);
final String packageId = iesu.uploadPackage(data);
final ImportInstruction instruction = new ImportInstruction();
final String processId = ies.startImport(packageId, instruction);
ProcessState state = ies.getProcessState(processId);
while (state != ProcessState.FINISHED && state != ProcessState.ABORTED) {
    state = ies.getProcessState(processId);
}
final ProcessInfo info = ies.getProcessInfo(processId);
final ProgressInfo pinfo = info.getProgressInfo().getValue();
if (state == ProcessState.ABORTED) {
    // THE NEXT LINE THROWS AN ERROR
    final byte[] logfile = iesd.downloadProcessLogFile(processId, false); 
    final String filename = processId + ".txt";
    final FileOutputStream fos = new FileOutputStream(filename);
    fos.write(logfile);
    fos.close();
    System.out.println("Import failed, see log file " + filename);
    throw new CoreServiceException("Import was aborted");
}

The call to downloadProgressLogFile always returns the same error:

nl.robeco.tridionscript.tridion.CoreServiceException: org.tempuri.IImportExportStreamDownloadDownloadProcessLogFileImportExportServiceFaultFaultFaultMessage: Process log file associated with the process 62344fe7fdfa436d91be20bed2d25ccd does not exist.

What am I doing wrong?

2
  • you have iesd.downloadProcessLogFile but is iesd defined? I assume it's not that simple... Commented Aug 17, 2016 at 17:00
  • I left out the assignment of the various web client variables for the sake of brevity
    – Quirijn
    Commented Aug 18, 2016 at 12:54

2 Answers 2

1

You may have to enable process logging in the ImportInstruction.

2
  • perhaps. we're on 2013 SP1. we aren't setting anything explicitly on ImportInstruction for logging, but Web 8 could be different Commented Aug 17, 2016 at 19:54
  • Thanks, that did the trick: final ImportInstruction instruction = new ImportInstruction(); instruction.setLogLevel(LogLevel.DEBUG);
    – Quirijn
    Commented Aug 22, 2016 at 13:40
1

in downloadProcessLogFile, we pass in "true" not "false." can you try that?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.