Logon with username and password

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Logon with username and password

WayneGraham
Hi

I am new to Quickfix and need help with the logon - am using VB.

I am currently able to to establish the connection, and initiate the logon. However, my logon seems to be getting rejected as I have not included the username and password correctly, so immediately get logged off.

Am I correct that once I have started an initiator, within the ToAdmin Sub, I need to check if the message is a Logon message and then add the username and password to the ToAdmin message. Do I also need to reset the BodyLength and Checksum after having done so? Do I then just re-send the message ? Sorry know this is probably basic stuff, but have been going round in circles for 2 days now.

Here is my code - does not cause logon:

Public Sub ToAdmin(message As Message, sessionID As SessionID) Implements IApplication.ToAdmin
        If message.GetType.ToString = "A" Then
            message.SetField(New Username("JHFTB1"))
            message.SetField(New Password("FG#T1K8"))
            _session.Send(message)
        End If
    End Sub

Thanks for any help.

Wayne
Reply | Threaded
Open this post in threaded view
|

Re: Logon with username and password

Grant Birchmeier
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX Support: http://www.quickfixengine.org/services.html


Don't call _session.Send() inside ToAdmin() or ToApp().

Those get called on every message that is *already being sent*.  It's basically an intercept, allowing to you mess with the message before it goes out.

Other than that, you're code looks correct to me (though it should be noted that I don't actually know VB).


On Tue, Aug 19, 2014 at 1:53 AM, WayneGraham <[hidden email]> wrote:
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX Support: http://www.quickfixengine.org/services.html

Hi

I am new to Quickfix and need help with the logon - am using VB.

I am currently able to to establish the connection, and initiate the logon.
However, my logon seems to be getting rejected as I have not included the
username and password correctly, so immediately get logged off.

Am I correct that once I have started an initiator, within the ToAdmin Sub,
I need to check if the message is a Logon message and then add the username
and password to the ToAdmin message. Do I also need to reset the BodyLength
and Checksum after having done so? Do I then just re-send the message ?
Sorry know this is probably basic stuff, but have been going round in
circles for 2 days now.

Here is my code - does not cause logon:

Public Sub ToAdmin(message As Message, sessionID As SessionID) Implements
IApplication.ToAdmin
        If message.GetType.ToString = "A" Then
            message.SetField(New Username("JHFTB1"))
            message.SetField(New Password("FG#T1K8"))
            _session.Send(message)
        End If
    End Sub

Thanks for any help.

Wayne



--
View this message in context: http://quickfix.13857.n7.nabble.com/Logon-with-username-and-password-tp6655.html
Sent from the QuickFIX - Dev mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Quickfix-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-developers



--
Grant Birchmeier
Connamara Systems, LLC
Made-To-Measure Trading Solutions.
Exactly what you need. No more. No less.

------------------------------------------------------------------------------

_______________________________________________
Quickfix-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-developers
Reply | Threaded
Open this post in threaded view
|

Re: Logon with username and password

WayneGraham
In reply to this post by WayneGraham
All sorted thanks