API Support Forum
OEC API > API Support > Can't find the Connect - Force Login OEC Trader feature in the api
Author Topic: Can't find the Connect - Force Login OEC Trader feature in the api
(3 messages, Page 1 of 1)
Moderators: VPfau
Posts: 226
Joined: Apr 24, 2012

Posted: Jun 29, 2016 @ 05:58 PM             Msg. 1 of 3
I'm looking for the OecTrader / TDM "force login" feature in the api. When I login to OEC Trader, there's a checkmark for Force Login. Similarly, there is also a check mark for auto-reconnect. I can see the auto-reconnect functionality in this api call:

OECClient namespace
void Connect(String^ host, int port, String^ username, String^ password, bool autoReconnect) ;

The other version of Connect in the api documentation:

void Connect(ServerInfo^ server, NetworkCredential^ credentials, ConnectionFeatures^ features)

is not available in the newest api as given in the OEC API Advanced Example. Its not available in the COM version either (

It is in this call that I could set the ConnectionFeatures::ForceLogin bool member.

Could you make this call available in the api?

Posts: 36

Posted: Jul 01, 2016 @ 09:28 AM             Msg. 2 of 3

The new Connect call is already available in the API by downloading Trader and grabbing the DLL like you seemed to have already done. If you want the updated API.xml documentation, I can work on that.

From a COM perspective, it is a little more involved. One of the parameters of this overloaded Connect method is a new type called ConnectionFeatures. This class utilizes a nested Builder type to construct the ConnectionFeatures object. Our COM generator cannot handle nested types, and without it, there would be no way to change the ConnectionFeatures (currently just AutoReconnect and ForceLogin) from their default values (false and true, respectively). Additionally, the ServerInfo type was added to combine the server address and port into a single object. The only way to set these values is through the constructor, but I don't think you can build COM objects this way. I will create a new task to review these items, but I don't know if they will be added to our COM package in the future, and if so, when.

One final note, if you use the original Connect method, ForceLogin will be true. This just means that an existing session will be kicked off by the new session.
Posts: 226
Joined: Apr 24, 2012

Posted: Jul 01, 2016 @ 05:15 PM             Msg. 3 of 3
If ForceLogin is true by default using the original Connect method, then we have no need to get this other method into the COM api.

This week we had a real account customer who wasn't able to log in to his account because it was being used in another location. We thought the behavior had changed for the original api Connect call we have always used, because it has always simply disconnected the other location. We'll continue to troubleshoot the customer's experience if it ever occurs again.