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!");
}