punkrockdontcare (6) [Avatar] Offline
#1
I have gotten up through section 8.11 and finally got it all to compile, but I can't login. I am able to create a new user, and can reach the Main App that way.

Using the debug panel I traced the calls all the way up to ServiceUtils.send(). The login and password get there fine. The output from Mongrel says

Processing SessionsController#create (for 127.0.0.1 at 2008-08-13 11:33:17) [POST]
Session ID: <OMITTED FOR BREVITY>
Parameters: {"format"=>"xml", "action"=>"create", "controller"=>"sessions"}
←[4;36;1mSQL (0.000000)←[0m ←[0;1mSET NAMES 'utf8'←[0m
←[4;35;1mSQL (0.000000)←[0m ←[0mSET SQL_AUTO_IS_NULL=0←[0m
←[4;36;1mUser Columns (0.000000)←[0m ←[0;1mSHOW FIELDS FROM `users`←[0m
←[4;35;1mUser Load (0.000000)←[0m ←[0mSELECT * FROM `users` WHERE (`users`.`login` IS NULL) LIMIT 1←[0m
Completed in 0.04700 (21 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/session.xml]


Notice SELECT * FROM `users` WHERE (`users`.`login` IS NULL). Does this mean that the login and password are not reaching the Rails backend? How do I debug this? How do I fix it?
punkrockdontcare (6) [Avatar] Offline
#2
Re: Iteration 8 - Can't login
Okay, it turns out it was a typo.

In ServiceUtils.as I had this line
service.contentType = sendXML ? "application/xml" : "application/x-www-form-urlencoded";
as
service.contentType = sendXML ? "application/xml" : "application/x-www-from-urlencoded";

Frustrating.
peterarmstrong (94) [Avatar] Offline
#3
Re: Iteration 8 - Can't login
Fat-fingering is always a danger with strings. (If HTTPService defined public static consts for these, then I would have used them.)

At least this way, the strings are kept inside ServiceUtils instead of scattered throughout the app.

Cheers
-Peter