Hello,
When using the below code, I have in some occasions a bug in :
resultTask = ExtractionsContext.ExtractRawAsync(request);
result = await resultTask;
with an exception thrown with ex.message=""Invalid response, could not parse the following response: \r\n\r\n\r\n<html>\r\n\r\n <head id=\"Head1\">, ...." the message being to too long to be shown.
It seems that the server is not responding in a proper way anymore. Is there a maximum number of concurent ExtractRawAsync that could cause the issue, or anything else that could explain this?
Thank you for your help,
SD
The code:
var condition = new TickHistoryTimeAndSalesCondition
{
ReportDateRangeType = ReportDateRangeType.Range,
QueryStartDate = startDate,
QueryEndDate = endDate,
ApplyCorrectionsAndCancellations = false,
ExtractBy = TickHistoryExtractByMode.Ric,
MessageTimeStampIn = TickHistoryTimeOptions.GmtUtc,
SortBy = TickHistorySort.SingleByRic,
DisplaySourceRIC = true
};
var rics = InstrumentManager.InstrumentList.Select(x => x.RDTHRic).ToArray();
var instrumentIdentifiers = rics.Select(x => InstrumentIdentifier.Create(IdentifierType.Ric, x)).ToArray();
var indentifierList = new InstrumentIdentifierList { InstrumentIdentifiers = instrumentIdentifiers };
var request = new TickHistoryTimeAndSalesExtractionRequest
{
Condition = condition,
ContentFieldNames = FIELDS,
IdentifierList = indentifierList
};
Task<RawExtractionResult> resultTask;
RawExtractionResult result;
try
{
resultTask = ExtractionsContext.ExtractRawAsync(request);
result = await resultTask;
}
catch (Exception ex)
{
var message = ex.Message.Replace("\n", "").Replace("\r", "").Substring(0, 25); InstrumentManager.EventsShowMsg("Error in task: " + message, false);
return;
}