Unable to connect a session using QuickFIXn and FIX5.0SP2

102 views Asked by At

I'm new to QuickFIXn and trying to implement a initiator for FIX5.0SP2. I'm created config and sample code as below. But when I run the application, I can only see OnCreate(Session) method called. The client is not gettign connected to the server and neither any Logon is sent. I think I've exhausted all my options to know why there is no connection and logon. Can someone please help out, it's very basic but I really don't know what I'm missing.

[DEFAULT]
ConnectionType=initiator
ReconnectInterval=10
FileStorePath=store
FileLogPath=log
StartTime=00:00:00
EndTime=23:55:00
UseDataDictionary=Y
TransportDataDictionary=C:\Users\<someuser>\source\repos\FIX-Client\FIX-Client\dict\FIXT11.xml
AppDataDictionary=C:\Users\<someuser>\source\repos\FIX-Client\FIX-Client\dict\FIX50SP2.xml
SocketConnectHost=101.1.2.3
LogoutTimeout=10
ResetOnLogon=Y
ResetOnDisconnect=Y
DefaultApplVerID=FIX.5.0SP2


[SESSION]
# inherit ConnectionType, ReconnectInterval and SenderCompID from default
BeginString=FIXT.1.1
SocketConnectPort=4000
SenderCompID=ABC
TargetCompID=ACCEPT
HeartBtInt=30

And here is the implementation

  String settingFile = "../../fixApp.cfg";
        SessionSettings settings = new SessionSettings(settingFile);
        IApplication fixApp = new QuickFixClient();
        IMessageStoreFactory storeFactory = new FileStoreFactory(settings);
        ILogFactory logFactory = new FileLogFactory(settings);
        QuickFix.Transport.SocketInitiator initiator = new QuickFix.Transport.SocketInitiator(fixApp, 
            storeFactory, settings, logFactory);

        initiator.Start();
        
        SessionID sessionId = new SessionID("FIXT.1.1", "XYZ", "ACCEPT");
       
        Console.WriteLine(initiator.IsLoggedOn); // returns False
        Session.LookupSession(sessionId).Logon(); // Throws Null pointer exception
0

There are 0 answers