Both transmission solenoids (A & B) failing at once is a good indication of a wiring harness or ground connection problem. We'd recommend having a transmission specialist inspect your Toyota Camry. If the problem isn't with the harness or ground, the next fault we'd suspect would be (very) dirty oil or foreign material stuck in the solenoid(s). In either scenario, since the trouble has caused the check engine light to illuminate, your Toyota Camry will fail the smog check if the faults are not repaired, and the check engine light not turned off.
If you remove the transmission pan and find excessive debris or metal shavings on the bottom of the pan and/or stuck to magnet attached to the pan, this is a good indication that, at best the solenoids are plugged up and in-operational, and worst, the transmission is ready to fail.