login method for WS connection.