Infront Data Manager Connect Client (.NET)
Get Symbol List for Exchanges

To get a list of active symbols for a exchange the following steps must be done:

  1. Create a Routing Data Store(Gevasys.DataCore.StaticData.Http.RoutingDataStore Class).
  2. Create a instance of the required request message.
  3. Optional: Implement the interface IAsyncRouteCallback ( Gevasys.DataCore.StaticData.IAsyncRouteCallback Interface) for the calling class.
  4. Execute the request.
using System;
using Gevasys.DataCore.RequestData.ProtoBuf.V2;
using log4net;
namespace Examples
{
class ExchangeSymbolList
{
private static ILog log = LogManager.GetLogger("ExchangeSymbolList");
private MessageSerializer serializer;
private RoutingDataStore rds;
public void Main()
{
ConfigurationHelper.Initialize();
serializer = new MessageSerializer();
rds = ConfigurationHelper.RoutingDataStore;
ExchangeSymbolListRequestMessage requestMessage = new ExchangeSymbolListRequestMessage
{
header = new RequestHeaderMessage
{
user = Authentication.GetUser(),
password = Authentication.GetPassword()
},
exchange = "BLN"
};
//Gets the exchange symbol list for exchange Berlin
StaticDataResponse response = rds.CallFunction(StaticDataFunctions.EXCHANGE_SYMBOL_LIST
, InputFormat.PROTO.ToString()
, OutputFormat.PROTO.ToString()
, serializer.Serialize<ExchangeSymbolListRequestMessage>(OutputFormat.PROTO, requestMessage));
if (response.GetErrorCode() != 0)
{
log.Warn("Error from calling function: ExchangeSymbolList: " + response.GetErrorMessage());
return;
}
ExchangeSymbolListMessage responseMessage = serializer.Deserialize<ExchangeSymbolListMessage>(InputFormat.PROTO, response.GetData());
if (responseMessage.header.error_code != ErrorCodes.Ok && responseMessage.header.error_code != ErrorCodes.Default)
{
log.Error("Fatal: " + responseMessage.header.error_message);
return;
}
// dump data
Console.WriteLine("Response contained vwd codes: " + responseMessage.symbols.Count);
foreach (String symbol in responseMessage.symbols)
{
Console.WriteLine("Code: " + symbol);
}
}
}
}

Note: Example available in samples folder in Data Manager Connect - Client Distribution".

Gevasys.DataCore
Definition: BinaryUpstreamClient.cs:5
Gevasys.DataCore.Configuration
Definition: ClassFactory.cs:17
Gevasys.DataCore.Webservice
Definition: Webservice.Generated/Reference.cs:11
Gevasys.DataCore.StaticData
Definition: AsyncFileDownloader.cs:10
Gevasys
Definition: BinaryUpstreamClient.cs:5
Examples
Definition: apiinitialize.cs:11
Gevasys.DataCore.StaticData.Http
Definition: AsyncFileDownloader.cs:10

Copyright (C) 2021 Infront Financial Technology GmbH
Mainzer Landstrasse 178 – 190
60327 Frankfurt am Main
Infront Data Manager Connect V4.1