1

When using the Client.StartExport command with the Core Service ImportExport client with the BasicHttp binding it works OK the first time, but a second action with the same Client in the Opened state fails.

However, if Fiddler is running on the machine it works fine. I've seen this article where running fiddler fixes the App and I'm wondering if I'm having the issue where the HTTPWebRequest is not closed? I get stuck in the state != ProcessState.Finished part. Any ideas?

var test = Client.TestConnection();

Debug.WriteLine("Connection: " + test);

Debug.WriteLine("Starting export: " + name);
Directory.CreateDirectory(WorkFolder);
// first export...
var exportInstruction = new ExportInstruction()
{
    LogLevel = LogLevel.Normal,
    BluePrintMode = BluePrintMode.ExportSharedItemsFromOwningPublication,
    ExpandDependenciesOfTypes = IncludeDependencyTypes
};
var selection = new Selection[] { new ItemsSelection(elements) };

_processId = Client.StartExport(selection, exportInstruction);
Debug.WriteLine("Export Process Started: " + _processId);

var state = WaitForProcess();
var result = GetProcessInfo();
if (state != ProcessState.Finished)
{
    throw new Exception("Export process Aborted!");
}
2

for us, we are using the below after the state is finished.

        $importExportServiceClient.Close()
        $importExportServiceClient.Dispose()
        $ImportExportDownloadServiceClient.Close()
        $ImportExportDownloadServiceClient.Dispose()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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