Skip navigation
Currently Being Moderated

Flex Builder 4 Data Service integration (PHP)

Mar 23, 2010 5:07 PM

Hi,

preface:

created a dataservice form a existing MySQL Database (Bioographies of Artists)

 

When I call the functions from within the Flash 4 Builders 'Data/Services' Tab they work flawless. (add, delete, update)

 

Lets assume that the following value object has been created:

'Artists_biography'

 

 

I try now to call the service via Actionscript like the following:

 

var updateObject:Artists_biography = new Artists_biography();
      updateObject.biography_de = contentToSave;
      updateObject.biography_id = biography_id;
      updateObject.artists_id = artist_id;
updateArtists_biographyResult.token = artistsbiographyService.updateArtists_biography(updateObject);

 

 

I get this:

Error: Unable to find data service for value: valueObjects::Artists_biography

 

I also tried to use the mxml valueObject like this:

<valueObjects:Artists_biography id='updateObject' />

 

Even the autocreated forms produce this error

Any hint why this happens ?

Help *please*

 
Replies
  • Currently Being Moderated
    Mar 25, 2010 9:50 AM   in reply to daslicht

    ... same Problem here... please help

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 29, 2010 2:48 AM   in reply to daslicht

    Hello,

     

    By default when PHP sample is generated from the database, Data Management is enabled on that service's entity (In your case, it is Artists_biography).

    So update method of 'Artists_biography' accepts only server managed valueObjects.

     

    There are 2 options if you want to use updateArtists_biography in FormGen

     

    1. Remove update method in Data Management wizard. Context click on entity and click 'Enable Data Management' and remove the 'update' method.

     

    or

     

    2. Use getItemById operation's result. Cast it to a valueObject, edit and pass as argument to updateArtists_biography .

     

     

    -Radhakrishna

     

     

     

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 28, 2010 5:22 AM   in reply to daslicht

    Now I have the same Issue with a simple getAllNews call.

    Any Idea how to fix this now ? please, when i call the function via the TestPalete its working.

     

    ArgumentError: Can't find ManagedQuery or ManagedOperation named: getAllNews
         at mx.data::RPCDataServiceAdapter/executeQuery()[C:\depot\DataServices\branches\lcds_modeler101\frameworks\projects\data\src\mx\data\RPCDataServiceAdapter.as:325]
         at mx.data::RPCDataServiceAdapter/processDataMessage()[C:\depot\DataServices\branches\lcds_modeler101\frameworks\projects\data\src\mx\data\RPCDataServiceAdapter.as:920]
         at RPCDataServiceRequest/invoke()[C:\depot\DataServices\branches\lcds_modeler101\frameworks\projects\data\src\mx\data\RPCDataServiceAdapter.as:1668]
         at mx.data::DataStore/http://www.adobe.com/2006/flex/mx/internal::invoke()[C:\depot\DataServices\branches\lcds_modeler101\frameworks\projects\data\src\mx\data\DataStore.as:3343]
         at <anonymous>()[C:\depot\DataServices\branches\lcds_modeler101\frameworks\projects\data\src\mx\data\DataStore.as:1579]
         at mx.data::DataStore/http://www.adobe.com/2006/flex/mx/internal::fill()[C:\depot\DataServices\branches\lcds_modeler101\frameworks\projects\data\src\mx\data\DataStore.as:1597]
         at mx.data::ConcreteDataService/internalFill()[C:\depot\DataServices\branches\lcds_modeler101\frameworks\projects\data\src\mx\data\ConcreteDataService.as:6936]
         at <anonymous>()[C:\depot\DataServices\branches\lcds_modeler101\frameworks\projects\data\src\mx\data\ConcreteDataService.as:1221]
         at mx.data::ConcreteDataService/fill()[C:\depot\DataServices\branches\lcds_modeler101\frameworks\projects\data\src\mx\data\ConcreteDataService.as:1240]
         at mx.data::ConcreteDataService/executeQuery()[C:\depot\DataServices\branches\lcds_modeler101\frameworks\projects\data\src\mx\data\ConcreteDataService.as:1254]
         at mx.data::DataManager/executeQuery()[C:\depot\DataServices\branches\lcds_modeler101\frameworks\projects\data\src\mx\data\DataManager.as:1355]
         at Function/http://adobe.com/AS3/2006/builtin::apply()
         at mx.data::ManagedOperation/queryProxy()[C:\depot\DataServices\branches\lcds_modeler101\frameworks\projects\data\src\mx\data\ManagedOperation.as:524]
         at mx.rpc.remoting::Operation/send()[E:\dev\4.0.0\frameworks\projects\rpc\src\mx\rpc\remoting\Operation.as:212]
         at _Super_NewsService/getAllNews()[C:\wamp\www\MusicShopWorkspace\SimpleA\src\services\newsservice\_Super_NewsService.as:202]
         at main_news_component/dataGrid_creationCompleteHandler()[C:\wamp\www\MusicShopWorkspace\SimpleA\src\main_news_component.mxml:107]
         at main_news_component/__news_DataGrid_creationComplete()[C:\wamp\www\MusicShopWorkspace\SimpleA\src\main_news_component.mxml:239]
         at flash.events::EventDispatcher/dispatchEventFunction()
         at flash.events::EventDispatcher/dispatchEvent()
         at mx.core::UIComponent/dispatchEvent()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:12266]
         at mx.core::UIComponent/set initialized()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1577]
         at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:759]
         at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1072]
    
     
    |
    Mark as:
  • Currently Being Moderated
    Jun 5, 2010 1:57 AM   in reply to daslicht-fXuEm8

    Me to, most of my services are not working any more. Exact same issue.

     

    Main Thread (Suspended: ArgumentError: Can't find ManagedQuery or ManagedOperation named: getAllShipping_rate_types)

    mx.data::RPCDataServiceAdapter/executeQuery

    mx.data::RPCDataServiceAdapter/processDataMessage

    RPCDataServiceRequest/invoke

    mx.data::DataStore/http://www.adobe.com/2006/flex/mx/internal::invoke

    <anonymous>

    mx.data::DataStore/http://www.adobe.com/2006/flex/mx/internal::fill

    mx.data::ConcreteDataService/internalFill

    <anonymous>

    mx.data::ConcreteDataService/fill

    mx.data::ConcreteDataService/executeQuery

    mx.data::DataManager/executeQuery

    Function/http://adobe.com/AS3/2006/builtin::apply [no source]

    mx.data::ManagedOperation/queryProxy

    mx.rpc.remoting::Operation/send

    _Super_ShippingratetypesService/getAllShipping_rate_types

    model.presentation::ShippingRateTypesPM/getAll

    pages::ShippingRateTypesPage/__list_creationComplete

    flash.events::EventDispatcher/dispatchEventFunction [no source]

    flash.events::EventDispatcher/dispatchEvent [no source]

    mx.core::UIComponent/dispatchEvent

    mx.core::UIComponent/set initialized

    mx.managers::LayoutManager/validateClient

    mx.core::UIComponent/validateNow

    mx.managers::PopUpManagerImpl/centerPopUp

    mx.managers::PopUpManager$/centerPopUp

    wawe_calculator/focusPage

    wawe_calculator/openPage

    wawe_calculator/handleNavigation

    wawe_calculator/___wawe_calculator_MainNavigation1_customers

    flash.events::EventDispatcher/dispatchEventFunction [no source]

    flash.events::EventDispatcher/dispatchEvent [no source]

    mx.core::UIComponent/dispatchEvent

    navigation.components::MainNavigation/handleClick

    navigation.components::MainNavigation/___MainNavigation_Button1_click

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 9, 2011 11:25 PM   in reply to daslicht

    Hi

     

    I was facing the same problem.

     

    As it was due to 'Data Management' property of DataService as per my understanding.

     

    So i have created another method in the php file with the same functionality ( just change the name of the method ) and refresh the service in FB 4 and use that method to update the data in the mysql table.

     

    Actually (as per my understanding ) the difference i found is only that the token returned by the original update method is an ItemReference type where as in custom method it returns a AsynToken.

     

    ItemReference is Strongly Typecast to the same value object which is associated with that service and if any property is missing in the returned object then it generates an error. As update method is not returned any object and it will reference to the original Referenced valueobject which is used to get the record using the getItemById(itemID).

     

    Where as AsynToken return a JSON object and untill we are not using any property of that returned object. DataService will not generate any error.

     

    Sorry if i am wrong with the above idea.

     

    So for now, it resolves my problem. But the actual problem is still there and finding its reason and conclusion why this problem is happening?

     

    Thanks

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 3, 2011 1:04 AM   in reply to Viren AS 3.0 Developer

    Same problem calling the same function from different actionscript component on the same application. The dataservice is not managed and is not paged.

     

    :-(

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 3, 2011 2:05 PM   in reply to daslicht

    Hi daslicht,

     

    what do you mean exactly about using ZendAMF without the wizard?

     

    Thanks,

     

     

     

    Il giorno 03/ago/2011, alle ore 19.18, daslicht ha scritto:

     

    I have meanwhile learned how to use ZendAMF without the wizard

     

    It's much more FLEXible

     

     

    But you can just create the code automatically and delete the service from the Services,

    so that you dont have to write the PHP Code manually 

    >

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 4, 2011 2:52 AM   in reply to daslicht

    these videos might help...

     

    http://www.youtube.com/watch?v=1n1uHQAP18Q

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 4, 2011 6:33 AM   in reply to daslicht

    Thanks a lot.

     

    But using corlan way you lost the Data Service View features of the new Ide and  the data management features like paginating and transactions....

     

    is It right?

     

     

    Il giorno 04/ago/2011, alle ore 11.24, daslicht ha scritto:

     

    OK I try to clear it:)

    By DataService Wizard I men the following:

    http://flashrealtime.com/wp-content/uploads/newfxphp/vyber-technologie -php.png

     

    When you automatically create PHP Services, the communication between Flex and PHP is solved by using the Zend Framework with help of the AMF Protocoll.

     

    Beside the integrated Zend Feature you can use it even manually which gives you more control

     

    e.g: http://corlan.org/2008/11/13/flex-and-php-remoting-with-zend-amf/

     

     

    Be welcome if you have any further questions.

    >

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points