I'm working thru the samples / tutorials from the Flex Developer Center and cannot seem to get things working for me. Specifcally, trying to implement the example from this page: http://www.adobe.com/devnet/flex/articles/crud_flex_php_zend.html. (PHP files I'm using are all linked from that page.)
When I run the program, I can retrieve the data from my server, but I get a "Channel Disconnected" error message whenever I try to write something back to the server.
The error message I find in the log files is:
PHP Catchable fatal error: Argument 1 passed to ForestService::updateForest() must be an instance of NationalForest, instance of stdClass given in /var/www/myCRUD-debug/ForestService.php on line 71, referer: http://vs1/myCRUD-debug/anotherCRUD.swf/[[DYNAMIC]]/5
This is consistent with the result I get when attempting to test the updateForest() function in Flash Builder. Screenshots of the test are per below:
I've tried various different syntaxes for the established: field (date(), current_date, "19990101", all UPPER, all lower, etc.) as I wasn't positive I could rule that out. (That said, I've noted that there is an error message at the bottom the input pane if things don't match what it believes the input to be.)
I've looked at the php files and can find no obvious syntax errors, no "echo" and no "print" statements. Also saw another post somewhere that suggested that it could be the port number I'm using, so have changed the ForestService.php file to point at localhost:3306. All this is leading me to think that there must be something fundamentally wrong with my setup, but not sure what that is. I can successfully pull data from the mySQL server, so I know the connection works. (Data loads to the datagrid.)
Issue occurs regardless of whether I use the canned example project (after updating the connection info in ForestService.php) or whether I build a new application from scratch.
Development environment is:
I'm at a total loss... Does anyone have a suggestion? Thanks in advance!
Finally some success... Went and had a coffee, got my mind off things and then tried again.
I started from scratch one more time using the canned examples. Seems the issue was related to the services-config.xml file. I'd updated this to point to the index.php file on the server, but for some reason, the updated value was not being passed to the application when it compiles. Figured it out when I got an error message in the fresh start that pointed at the wrong location.
Closed Flash Builder and restarted after verifying that the location was set correctly in services-config.xml. This time when I ran the update script, it worked. Validated that the changes were passed to the DB via an independent query and all is good!
Now I just have to figure out how to make that work consistently and things should be good...