The array required message is a problem with your instance variables, userName and password are Strings not string arrays.
Not sure about the second point but this should be able to help
...