5 Replies Latest reply on Jan 17, 2010 7:09 AM by SunilAdobe

    How to update service?

    teocomi

      Hello, I think the new Data/Services feature  in Flex 4 is great!

      Is there a way to automatically update a service? For instance, Flex can automatically create a service to connect to a database, but if I edit the mysql table structure then I have to delete the service and create a new one..

      Thanks!

        • 1. Re: How to update service?
          SunilAdobe Adobe Employee

          You don't need to delete the service, you just modify your code / sql in the service file (php) and FlashBuilder will automatically refresh if you have added any additional methods and show them in the data/services panel.

           

          Thanks

          -Sunil

          • 2. Re: How to update service?
            teocomi Level 1

            I'm sorry I did non explain properly, what I would like to update is the valueObject related to the service..

            • 3. Re: How to update service?
              SunilAdobe Adobe Employee

              If you have used strong types on the server side (for example employee value object on flex side is actually employee.php on the server side), it would automatically modify it. However if you have used configure return type option, to create employee value object on the Flex side (it is weak type on the server side), you might have to use configure return type again to change the value object.

               

              You may also see that configure return type will automatically merge any additional changes, let us know if you run into issues.

               

              Thanks

              -Sunil

              1 person found this helpful
              • 4. Re: How to update service?
                teocomi Level 1

                Well, pardon me, this is what I did:

                - I created a mysql table employee in the database

                - I created a service connecting to it in Flex, and I had the php class automatically created EmployeeService.php

                - The Employee valueObject was automaticaly created too

                - If I add or remove some values to the employee table, and edit relative code in  EmployeeService.php, the valueObject does not update

                 

                I'm not sure if this is Strong or Weak type, what am I doing wrong? How to create strong type on the server side?

                Thanks a lot,

                Matteo

                • 5. Re: How to update service?
                  SunilAdobe Adobe Employee

                  This is weak type on the server side.

                   

                  >>the valueObject does not update<<

                  You will have to use "configure return type" the right click menu option in the data/services panel, to update the data type.

                   

                  >>How to create strong type on the server side?<<

                   

                  If you want to have strong type on the server side, you will have to create a Employee.php which represents the Employee data structure and you will have to start returning that type in your php methods.

                   

                  You can continue with the configure return type option, so that you don't have to worry too much on the server side.

                   

                  Thanks

                  -Sunil