I've made a simple application that uses the php service and the zend framework on wamp
The database has three fields, one primary index.
The project creation process works fine and when I create the data service with the wizzard, I get all the CRUD
that I need.
I set up a data grid and bind it to getAll<tablename>. I run the app and all is fine (I see an empty table)
My network monitor indicates I made a getAll query and it shows an okay result
I set up a Data>generate form wizzard and bind it to create<tablename>(item...)
I run the app and get the datagrid and the form with fields to enter my data, a button to create the item in the table and a result text box
When I enter data and press the create button, I do not get any results ( I should get a 0) I've stepped through the program and I never get a return token.
My network monitor does not inidicate that I had any network traffic (nothing from my client to the php code on the server)
To make things more interesting, when I do a Data/Services>Test Operation on the create function, I can load a set of data, run the test and it works! Data shows up in my table and the test response code is 0
My question is, how do I debug the php service call on the client side as it does not seem to be working.
I loaded flashbuilder 4.5 on another windows system with wamp and zend and got exactly the same result.
I now have two systems that do exactly the same thing. I have a zipped directory of the project and can send it to someone who might
be interested in this bug.
As I step through the code I reach the operationManager object and the debugger can no longer see the code (it is part of the mx libraries I guess).
At any rate, there is never a network call for the create<>(item...) operation so it must be in the mx.data.RPCDataManger, mx.data.DataManager, mx.data::ConcreteDataService/createItem
So, pjlumby has uncovered what we believe is a bug in the data service wizard. It turns out that when you use the auto generated service calls that change the database such as create<blah>(item), update<blah>(item) and possibly delete<blah>item(itemID) that the data service does not 'commit' the change so nothing happens to your database. No call to the PHP code, no network traffic.
However, there is a 'commit()' function in the _Super_<blah>.as file in your services directory. If you put a break point there, you will see that the method is never called. Hmmmm.
If you add the 'commit()' statement at the end of all the methods (before the return) that modify the database (see first paragraph)[methods are located in _Super_<blah>.as in your services directory], well, things start working the way they are suppose to.
Hope this helps those who have this bug. I've wasted three days on this.
Big thankyou to pjlumby.
Glad it helped! I'm not a big IDE fan and this is one of the reasons. The IDE developers think they have all their bits covered and all a user has to do is follow their wizards and examples, unfortunately, when they have some bad bits, the IDE hides the sources necessary to really see what is going on. I really want to make flashbuilder work but it's stuff like this that makes me remember why I like all the sources, VIM and Make
Now I have the "commit();" code before the return of each function in the "Super...Service.as" file but I I still get this error and my php-mysql data connection settings are there:
Channel disconnected before an acknowledgement was received
If you have any suggestions of what can this be I would truly appreciate your help. Thank you.
You may want to monitor your network traffic to make sure that you are talking to your server. The error you reported would indicate that you are attempting network connection to your server but your server is not responding. I would dig deeper and look at the network monitor tool to be sure you are getting traffic out of your flash.
It has been a long time since I played with the php wizard. I've moved on to my own python services and use standard http cgi api calls with json return objects.
flashbuilder actually has a network monitor (one of the tabs in the bottom window by whre the problems an data service tags are).
I use python mod_wsgi. There is a bit of setup but once configures life gets real easy. I can create a new interface in minutes and dashboards that include the flash code and the service side code in under an hour. There is learning curve and a set up curve.