API Support Forum
OEC API > API Support > Remoting still logs off
Author Topic: Remoting still logs off
(19 messages, Page 1 of 1)
Moderators: VPfau
JWeissbard91
Posts: 21
Joined: Dec 18, 2007


Posted: Jun 20, 2011 @ 11:49 AM             Msg. 1 of 19
Hello,
I am trying to implement the new remoting functionality.

The situation as it stands now is that the user is first running OEC's program. Then when custom program is run the user is kicked off the account from the OEC program.

As I understand it remoting is supposed to get around this issue. I changed

OEC.API.OECClient OECClient = new OEC.API.OECClient();
to
OEC.API.OECClient OECClient = OEC.API.OECClient.CreateInstance(true);

Is there something else that I'm supposed to do as well?

Thank you,
Jonathan
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Jun 20, 2011 @ 12:02 PM             Msg. 2 of 19
Jonathan, this change should be enough to make your application is working with OECAPI hosted by OEC Trader via remoting.

Victor Vins
Lead Software Developer
JWeissbard91
Posts: 21
Joined: Dec 18, 2007


Posted: Jun 20, 2011 @ 01:48 PM             Msg. 3 of 19
Hi,
Thanks for the reply.

Is there a way to check that the first application has set OECClient.RemoteHostingEnabled to true? If that wasn't set correctly that would explain the behavior, correct?

Thanks,
Jonathan
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Jun 20, 2011 @ 03:01 PM             Msg. 4 of 19
Unfortunately, OECAPI has no such method to check it. But I can advise to check "Allow Remoting" checkbox in OEC Trader: it controls OECClient.RemoteHostingEnabled there.

Victor Vins
Lead Software Developer
JWeissbard91
Posts: 21
Joined: Dec 18, 2007


Posted: Jun 20, 2011 @ 10:33 PM             Msg. 5 of 19
Hi,
I'm looking at the code in "OEC API Adv Example 2008" and searching for "RemoteHostingEnabled" to check that it's being set to true. I can't find the line in the example. Is it missing from the API example and is somewhere else instead?

Thank you,
Jonathan
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Jun 22, 2011 @ 08:18 AM             Msg. 6 of 19
Jonathan,

OEC API Adv Example doesn't show how to use Remoting.

Victor Vins
Lead Software Developer
JWeissbard91
Posts: 21
Joined: Dec 18, 2007


Posted: Jun 22, 2011 @ 11:28 PM             Msg. 7 of 19
Okay. How can I add remoting to it? Also is it possible to run the Trader App against the dev server?
JWeissbard91
Posts: 21
Joined: Dec 18, 2007


Posted: Jun 28, 2011 @ 01:28 AM             Msg. 8 of 19
Hi,
To clarify the issue a little. The code as it stands now is as follows:


objOECClient = OEC.API.OECClient.CreateInstance(True)
objOECClient.Connect(strServer, intPort, strUser, strPassword, False)

When I test it by running the Trader application and then my application the first account is booted out. I don't see a lot that could be going wrong here, but I must be missing something.
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Jun 30, 2011 @ 08:23 AM             Msg. 9 of 19
Hello,

you don't need to call objOECClient.Connect(strServer, intPort, strUser, strPassword, False), if objOECClient instance is shared with a remoting instance of another application and that instance already connected. So, it could look like

objOECClient = OEC.API.OECClient.CreateInstance(True)
if(!objOECClient.CompleteConnected)
objOECClient.Connect(strServer, intPort, strUser, strPassword, False)

Victor Vins
Lead Software Developer
JWeissbard91
Posts: 21
Joined: Dec 18, 2007


Posted: Jul 12, 2011 @ 12:00 AM             Msg. 10 of 19
Hi,
It doesn't kick me off as long as I sign on two programs on the same computer. With different computers it kicks me out. Is that supposed to be the case?

Also though I'm signed in I'm not getting the OnTicks event fired. Any ideas on why that would happen? Do I need to flag it differently?
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Jul 15, 2011 @ 08:50 AM             Msg. 11 of 19
Hello,

OECAPI Remoting is working only in the case if both client applications are on the same computer.

About OnTicks: could you please make sure that both applications are using absolutely the same versions of OEC API DLLs?

Victor Vins
Lead Software Developer
CChen15
Posts: 121
Joined: Jul 23, 2009


Posted: Jul 17, 2011 @ 09:39 AM             Msg. 12 of 19
Hello.

Having made a small modifications to the 'Sample COM Book.xls' I was able to make a remote connection to a running Trader. But the first reference to properties of a class

Glob.c.RequestContracts Glob.c.BaseContracts.FindBySymbol("ESU1")

causes an error:

[Microsoft Excel: "430 - Class does not support Automation or does not support expected interface"] if error handle placed in class module, or

[Microsoft Visual Basic: "Run-time error '-2147467262 (80004002)': Return argument has an invalid type."] if error handle placed in sheet "Config" module in "UpdateStatus" sub.



- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Chen Hua, Russia

Edited by CChen15 on Jul 17, 2011 at 09:40:12
Edited by CChen15 on Jul 17, 2011 at 09:40:56
CChen15
Posts: 121
Joined: Jul 23, 2009


Posted: Jul 21, 2011 @ 07:50 AM             Msg. 13 of 19
Up

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Chen Hua, Russia
CChen15
Posts: 121
Joined: Jul 23, 2009


Posted: Jul 21, 2011 @ 02:17 PM             Msg. 14 of 19
VictorV, I'm waiting for reply to my post from Jul 17, 2011 09:39 AM whily you are answering to other questions. Need I be more patient and wait anymore? Or explain please if you wan't or can't response me.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Chen Hua, Russia
CMicciche2
Posts: 3
Joined: Jul 21, 2011


Posted: Jul 21, 2011 @ 05:40 PM             Msg. 15 of 19
Your API is out of date since you are getting Automation error, please install the latest at: http://api.openecry.com/Sections/Misc/DownloadFile.aspx?ClientUpdate=0_5003_1&NoCache=83e01304-bf20-46aa-8b39-ca72faa400e4


Chris Micciche
Edited by CMicciche2 on Jul 21, 2011 at 17:40:55
JWeissbard91
Posts: 21
Joined: Dec 18, 2007


Posted: Jul 22, 2011 @ 10:39 AM             Msg. 16 of 19
Hi,
It doesn't kick me off as long as I sign on two programs on the same computer. With different computers it kicks me out. Is that supposed to be the case?

Also though I'm signed in I'm not getting the OnTicks event fired. Any ideas on why that would happen? Do I need to flag it differently?
CMicciche2
Posts: 3
Joined: Jul 21, 2011


Posted: Jul 26, 2011 @ 01:06 PM             Msg. 17 of 19
Quote: It doesn't kick me off as long as I sign on two programs on the same computer. With different computers it kicks me out. Is that supposed to be the case?


Remoting is done with same computer, as Victor explained above. To use two separate computers will not be possible with one login. Clients must use same computer if they wish to share login.

Quote: Also though I'm signed in I'm not getting the OnTicks event fired. Any ideas on why that would happen? Do I need to flag it differently?


Will need the developers to respond to this question...


Chris Micciche
Edited by CMicciche2 on Jul 26, 2011 at 13:10:56
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Jul 26, 2011 @ 02:26 PM             Msg. 18 of 19
I had placed the issue with OnTicks event to development queue for investigation.

Victor Vins
Lead Software Developer