How to get source list and dictionary with webSocket API?

I try to request the domains Source and SymbolList in the WebSocket API in order to retrieve the source list and dictionary. It was possible to retrieve these data by requesting the RMDS infra using the library RFA but we don't how to do it with WebSocket API.

We try this request but it doesn't work.

Request:

{

"ID": 2,

"Domain": "SymbolList",

"Key": {}

}


response:

{

"ID": 2,

"Type": "Status",

"Domain": "SymbolList",

"State": {

"Stream": "Closed",

"Data": "Suspect",

"Code": "AlreadyOpen",

"Text": "Request Rejected: Request key did not contain service Id."

}

}


thanks for your help!

Best Answer

  • umer.nalla
    Answer ✓

    Hi @lucas.briere

    Please refer to the Websocket API Tutorial for Request Data before attempting to code, it will clarify several points.

    A SymbolList is a special domain that can allow the publishing and consumption of a list of related symbols. It will not yield a Data Dictionary nor a Source Directory. If your source did support a SymbolList, you would need to provide a Key i.e. RIC code for the SymbolList e.g '.AV.L'

    {
      "Domain":"SymbolList",
      "ID":2,
      "Key":{
        "Name":[
          ".AV.L"
        ],
        "Service":"ELEKTRON_DD"
      }
    }

    Also, on some servers, if your request is rejected with a message similar to 'Request key did not contain service Id' then you will need to explicitly specify the service you want to source the data from because a default service has not been defined on that server. However, in your case, this could be a red herring because the key is empty.

    e.g. for a Source directory for all Services :

    {
      "Domain":"Source",
      "ID":3,
      "Key":{
        "Filter":1
      }
    }

    For Dictionary, it would be something similar:

    {
      "Domain":"Dictionary",
      "ID":4,
      "Key":{
        "Name":"RWFEnum",
        "Filter":7
      }
    }

    and repeat for 'RWFFld'.

    You can find full details of the filter values etc in the RDMUsageGuide Documents provided with the Real-Time SDKs





Answers