Session GetaTableManager not working

Moderator: Moderator

Session GetaTableManager not working

Postby sparklin » Mon Mar 07, 2016 5:48 pm

Hello,

I am receiving an O2GTableManagerStatus.TablesLoadFailed status every time I create a new instance of the O2GTableManager.

API Version 1.3.0 (Have tested the latest beta release and the problem exists there too)

I've been use the API for a while now with no problems until after this weekend. The problem is also occurring in all the sample applications that come with the API.

Here is the sample code from the PrintTable sample (this happens in all table manager samples though). The following code raises the exception:

Code: Select all
if (managerStatus == O2GTableManagerStatus.TablesLoadFailed)
                    {
                        throw new Exception("Cannot refresh all tables of table manager");
                    }


Here is code in context from the sample:
Code: Select all
session = O2GTransport.createSession();
                session.useTableManager(O2GTableManagerMode.Yes, null);
                SessionStatusListener statusListener = new SessionStatusListener(session, loginParams.SessionID, loginParams.Pin);
                session.subscribeSessionStatus(statusListener);
                statusListener.Reset();
                session.login(loginParams.Login, loginParams.Password, loginParams.URL, loginParams.Connection);
                if (statusListener.WaitEvents() && statusListener.Connected)
                {
                    O2GTableManager tableManager = session.getTableManager();
                    O2GTableManagerStatus managerStatus = tableManager.getStatus();
                    while (managerStatus == O2GTableManagerStatus.TablesLoading)
                    {
                        Thread.Sleep(50);
                        managerStatus = tableManager.getStatus();
                    }

                    if (managerStatus == O2GTableManagerStatus.TablesLoadFailed)
                    {
                        throw new Exception("Cannot refresh all tables of table manager");
                    }

                    O2GAccountRow account = GetAccount(tableManager);
                    if (account == null)
                        throw new Exception("No valid accounts");

                    PrintOrders(tableManager, account.AccountID);
                    Console.WriteLine("Done!");

                    statusListener.Reset();
                    session.logout();
                    statusListener.WaitEvents();
                }
                session.unsubscribeSessionStatus(statusListener);



Can anybody please shed some light on the issue or has there been some breaking changes over the weekend?

Thanks,

Shaun
sparklin
 
Posts: 3
Joined: Mon Mar 07, 2016 5:37 pm

Re: Session GetaTableManager not working

Postby benjo61 » Wed Mar 09, 2016 3:24 am

I have also been having this issue since the weekend on code that had been working fine for a long time. I think something has been changed.
Like you I have tried with the new version, various account logins and the sample software. Result is the same. Login is fine but tablemanager fails. It would be great if someone could shed some light on this, as functionality is greatly reduced without it.

Regards,

Ben
benjo61
 
Posts: 5
Joined: Mon Aug 06, 2012 6:52 am

Re: Session GetaTableManager not working

Postby Julia CJ » Wed Mar 09, 2016 6:29 am

Hello Sparklin and Benjo61,

To understand this problem, please answer some questions.

Could you specify the login parameters? Which connection do you use?
Does this login work in TS?
Thank you.
Julia CJ
 

Re: Session GetaTableManager not working

Postby sparklin » Thu Mar 10, 2016 4:19 am

Hi Julia,

"Could you specify the login parameters? "
Account: Demo or Real. All accounts, have this issue. I have tried new demo accounts.

"Which connection do you use?"
DEMO AU
UR:: http://www.fxcorporate.com/Hosts.jsp

"Does this login work in TS?"
YES

Regards,

Shaun
sparklin
 
Posts: 3
Joined: Mon Mar 07, 2016 5:37 pm

Re: Session GetaTableManager not working

Postby sparklin » Thu Mar 10, 2016 4:27 am

I forgot to mention that this is a problem with both the 32 bit and 64 bit versions of the .NET 4.0 API.

The samples I am testing are the C# samples.

Shaun
sparklin
 
Posts: 3
Joined: Mon Mar 07, 2016 5:37 pm

Re: Session GetaTableManager not working

Postby benjo61 » Thu Mar 10, 2016 5:45 am

Hi Julia,

The code I am having trouble with is the COM based code used in Excel.
Login Parameters:
Login, Password, URL = http://www.fxcorporate.com/Hosts.jsp, Connection = Demo

The account logs in fine to TS. I can also perform other non table manager based tasks with the api.

Until now have used this code for over a year with no issues.

A good way to replicate this issue would be to get the sample workbook provided with the api at:

\Candleworks\ForexConnectAPI 1.4.1\ForexConnectAPI\samples\com\VBA\CreateEntryOrder.xlsm

Generate a new demo account (from fxcm website), login and then click 'Show Accounts and Instruments Button'. I get the same problem here, regardless of which account I use.

The code is similar to below (although mine waits for an session_ManagerStatusChanged event response). Basically getstatus goes straight to TableManagerStatus_TablesLoadFailed as soon as getTableManager is called. It usually goes to a loading phase and then Status Manager triggers an event notifying of success (loaded) or fail.

Code: Select all
Call session.useTableManager(TableManagerMode_Yes, Nothing)
Call session.Login(Range("Login").Value, Range("Password").Value, Range("URL").Value, Range("Connection").Value)
Dim mTableManager As ITableManager
Set mTableManager = mSession.getTableManager()
Do While mTableManager.GetStatus() <> TableManagerStatus_TablesLoaded And mTableManager.GetStatus() <> TableManagerStatus_TablesLoadFailed
DoEvents
Loop


Thanks for your help
benjo61
 
Posts: 5
Joined: Mon Aug 06, 2012 6:52 am

Re: Session GetaTableManager not working

Postby Julia CJ » Fri Mar 11, 2016 6:56 am

Hello Benjo61 and Sparklin,

Thank you for the detailed description.We have managed to reproduce the issue. This is really the server problem. We have informed about it the server-side team.
Julia CJ
 

Re: Session GetaTableManager not working

Postby benjo61 » Sun Mar 13, 2016 6:09 pm

Hi Juila CJ,

Thanks for your feedback.
The tablemanager events to now appears to be firing correctly, however there is now a secondary issue

Once the tablemanager object has been loaded. The next step is to use it to populate various tables such as offers, accounts etc. This also seems to be working okay as the individual table objects are populated.

Code: Select all
Dim Offers As OfferTable
Dim Accounts As AccountTable
Set Offers = tableManager.getTable(TableType_Offers)
Set Accounts = tableManager.getTable(TableType_Accounts)


However when I then try to obtain a single row from the table, I receive the following error
"Class does not support Automation or does not support expected interface." I think the same error occurs if any method is called from the AccountTable object.
[code]
Dim AccountRow As AccountTableRow
Set AccountRow = Accounts.getRow(0)
[code]

Again this error can be replicated with sample documentation mentioned in my previous post.

Thanks again for your help.

Ben
benjo61
 
Posts: 5
Joined: Mon Aug 06, 2012 6:52 am

Re: Session GetaTableManager not working

Postby Julia CJ » Wed Mar 16, 2016 6:13 am

Hi Benjo61,

I receive the following error
"Class does not support Automation or does not support expected interface." I think the same error occurs if any method is called from the AccountTable object.
[code]
Dim AccountRow As AccountTableRow
Set AccountRow = Accounts.getRow(0)
[code]


We will fix this problem and update ForexConnect beta version in the nearest time.
Thank you for this information.
Julia CJ
 


Return to ForexConnect API

Who is online

Users browsing this forum: No registered users and 9 guests