Keeping FlexSession between two AMF java client remote calls
Hi,
I'm currently writing a java class that connects to Blazeds amf endpoint of "myApp".
The clue is that I don't keep my Flex Session between the two method calls.
The first call to "authenticate" takes two arguments "login", "password". And the second one "checkSession" uses data stored in the FlexSession.
In the "authenticate" service I use the flex session to store information about the connected user :
Code:
1 2 3
|
FlexSession session = FlexContext.getFlexSession();
session.put(name, attribute); |
After I call the second method -> "checkSession" service I get the following error :
Citation:
ClientStatusException
message: flex.messaging.MessageException: Unable to create a new instance of type 'exception.MyException'. Types cannot be instantiated without a public, no arguments constructor.
code: AMFConnection.Call.Failed
So, I created a third method that checks if the current user of my session is the same as the one that is trying to recall the service
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
public boolean userAlreadyConnected(String login, String mdp) throws MyException
{
String sessionId = userDao.userAlreadyConnecte(login, mdp);
// no session
if ("".equals(sessionId))
return false;
// session
UserDto user = MySessionProxy.getUser();
// It's me -> ok
return !sessionId.equals(user.idSession);
} |
and this method returns false !!!!!
How can I keep my session between two calls please ?