How to bind a PHP service to an ArrayCollection

Ok. i have used Flash builder data connect wizard to connect to my database and generate some PHP services.
One of them being a get all service.
I can drag and drop that onto a datagrid fine and it works.
But
Could someone please tell me, with as much detail as possible how to call that service, and bind it to an array/arraycollection.

Hi,
I meant to use the code completion when you create the service instance in MXML.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"    
     xmlns:s="library://ns.adobe.com/flex/spark"
     xmlns:mx="library://ns.adobe.com/flex/mx"
     minWidth="955" minHeight="600"
     xmlns:services="services.*"
     >
     <fx:Script>
          <![CDATA[
               import mx.collections.ArrayCollection;
               import mx.rpc.events.FaultEvent;
               import mx.rpc.events.ResultEvent;
               [Bindable]private var images:ArrayCollection;
               protected function myService_resultHandler(event:ResultEvent):void
                    images = event.result as ArrayCollection;
               protected function myService_faultHandler(event:FaultEvent):void
                    trace(event.fault.faultString);
               protected function button1_clickHandler(event:MouseEvent):void
                    myService.tblimagesService.getAllTbl_images();
          ]]>
     </fx:Script>
     <s:Button label="Get Data" click="button1_clickHandler(event)"/>
     <fx:Declarations>
          <services:TblImagesService id="myService"
               result="myService_resultHandler(event)" fault="myService_faultHandler(event)"/>
     </fx:Declarations>
</s:Application>
The previous example is modified to include the namespace in the application tag, assuming that yourTblImagesService is in the services folder. If it is different, change the namespace declaration .

Similar Messages

  • How to track down php service fault

    I have a small FlashBuilder4 project that runs fine on my local computer under Apache, PHP and MySQL.The first thing it does is populate a DataGrid with data from a MySQL table (the grid's creationcomplete event triggers a PHP service call and has its dataprovider hooked to the callresponder's lastresult property).
    As is often the case, I'm having trouble deploying the project to a remote, hosted server. I have uploaded the Zend framework, the release build, transferred my tables to the remote server, set the paths, etc. After several initial problems I believe I've got the ini file and everything else set up correctly (if I browse to my gateway.php and open it in notepad I get "Zend endpoint" with no errors). I have entered the credentials in each php service file. However, when I browse to the html wrapper page the grid displays fine but the phpservice call is apparently generating a fault. Unfortunately, there is no error information returned by the fault; i.e. the Alert box is blank.
    Can anyone suggest a methodical way of trying to track down what is going on?
    Thanks in advance.

    You cannot. Sorry.  You could try calling it via facetime, if  you have facetime, and listen for the ringing.
    BTW, typing in all caps indicates shouting, is considered rude and is difficult to read.
    Many simply do not read such posts.

  • How to update the PHP Class Service back in Flash Builder 4

    I'm not sure if my post title makes any sense or not but let me explain.  I've been working on an application in Flash Builder 4 using the ZendFramework and PHP services and everything is work great. the problem I have is after I make changes to my services PHP class (edit php file that has my functions in it), how to I updated those functions in the Flash builder application?
    For example, I needed to pass a second object into one of my function in my PHP class and after I edited the file and saved it, I don't see the changes in the Flash builder 4 application. Is there a button I can run to update the PHP class back in Flash Builder?
    Thanks,
    John Baranowski

    How do you use Flash Builder to regenerate the code for the same PHP service I connected to prior? When I first connected to the PHP service Flash Builder automatically built a package with all kinds of actionscript functions in it. I added a function to my PHP Class file server side and I need help on how to update the package back in Flex to see my new function. Can anyone help me??
    -John

  • How to bind complex input/output types in web service data control

    Hi,
    I have created data control using external web service for simple input & output data type and its working fine.
    But I don't know how it can be done for complex data types.
    My external Web services have complex input & output types. Such as java object which contains another java object again it contains another java object or arry or java collection etc.
    Each my service has one complex input data type and for this no user input is require so how I can do it without using any component for it.
    I want to bind my page components with this input & output type.
    What is the best approach to do this and how to bind screen component.
    Regards,
    Devang

    Hi,
    Thanks frank.
    I already check this link before posting this so if you have any other link then kindly reply.
    Regards,
    Devang

  • How to bind list data to XML Web service request

    How do I bind specific columns in a DataGrid to the Web
    service request? I'm having trouble finding any documentation that
    addresses that specific pattern, i.e. sending a complex list to the
    server via a Flex Web service send() command. I'm fairly new to
    Flex programming and don't know if what I want to do is possible.
    Here what I've been able to do so far.
    1. Using a Web service called a service on the server and
    retrieved a complex list.
    2. Poplulated a DataGrid with the result
    3. The user has selected multiple rows from the DataGrid
    using a checkbox column
    4. The user pressed a button that calls a Web service send().
    This Web service should only send data from only two columns and
    only for those rows the user has checked.
    5. I can loop over the DataGrid and find the selected rows
    and put them in another ArrayCollection called 'selectedRows'.
    The issue is that I don't know how to bind 'selectedRows' to
    the Web service. Right now I'm reading up on "Working with XML" in
    the Programming with ActionScript 3.0 chapter. But I'm just fishing
    here. No bites yet.

    Don't bind. Build the request object programatically, as you
    are doing with your selectedRows AC, and send(myObject) that.
    Tracy

  • How to bind to REST web services?

    The REST web services don't provide WSDL. How to bind this kind of services?
    Thanks.

    Melvin, not yet (in fact it's on my plate) - what I usually argue for is to abstract these pieces into services (much like what I did in the rest sample, and then expose them .. )
    In any case - I will start collecting ideas (that is topics) for best practices soon .. Let me know if you have any specific wishes.
    cheers

  • Connect Flash Builder 4 to remote PHP service

    Hello i have seen some videos that explained how easy is connect Data/Services to local PHP server, and then extract the methods instantly. Also binding it to a datagrid, and everything was with wizard, easy and fast.
    I would like to do the same but my problem is that i always work with remote PHP (not localhost), and i don't know how to connect flash builder 4 to my remote PHP class.
    PS: I know how to do it manyally, but then i would not use the power of the wizards.
    ¿Is there any solution?
    thanks

    Would you mind giving me an example?:
    the server path is /httpdocs/
    and my website is for example: http://www.smspubli.com
    I though that maybe the solution is on mount a virtual folder that connects to my httpdocs via FTP (problem is that in mac os it lets you create virtual folders but only in read mode)...
    Please help me, there is no solution in all internet and then only way to use the power of flash builder 4 is connecting to localhost...

  • How to design a wcf service for specific requirement

    i have 2 question on wcf.
    1) suppose some one develop a bus booking service using wcf and expose the same service over 2 different endpoint like tcp and http but i like to know what would be the advantage of having 2 or more endpoint for single service ? in what kind of situation
    people use this trick? discuss in details.
     2) how can i offer some extra functionality for tcp client. suppose my service has 5 function but http client can call only 2 and tcp client can call all. how do i design wcf service in this way. any idea would be appreciated. thanks

    Hi Mou_kolkata,
    >> 1)what would be the advantage of having 2 or more endpoint for single service ? in what kind of situation people use this trick? discuss in details.
    In my mind the advantage of providing different endpoints for a single service is that each endpoint could use different binding and we would use different endpoints for logical grouping by function, we could also apply different levels of security
    in the binding for each endpoint. For example you can expose an interoperable endpoint for Java, PHP, ... clients and a proprietary binary endpoint which could be faster but only for .NET clients.
    Besides, please also try to check this similar thread:
    http://stackoverflow.com/questions/6033788/when-why-would-i-use-multiple-endpoints-vs-a-single-endpoint-in-a-wcf-service .
    >> 2) how can i offer some extra functionality for tcp client. suppose my service has 5 function but http client can call only 2 and tcp client can call all. how do i design wcf service in this way. any idea would be appreciated.
    An esay way is to create two services. One service is for http client with 2 functions and the other service is for tcp client with 5 functions.
    Or maybe you need do some authentication, for more information, please try to refer to:
    http://stackoverflow.com/questions/11566182/how-do-i-restrict-access-to-some-methods-in-wcf .
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to consume a web service provided by third party system from SAP system

    Hi Friends,
    Could any of you provide me a clear picture on how to consume a web service from SAP system and is provided by a third party system?
    Do we get an URL to create a client proxy for consuming the web service?
    Thanx in advance,
    Ram

    Hi Ram,
    of course you cannot supply the WSDL URL. Inside the WSDL (just view it in your browser) you find (usually but not necessary) towards the end something like
    <soap:address location="http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php"/>
    which is the actual adress of the service.
    An example service can be found here:
    <a href="http://www.weather.gov/xml/">National Digital Forecast Database</a>
    containing the WSDL URL at
    <a href="http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl">this address</a>.
    You might also want to browse for the amazon webservices which allow you to embed queries against amazon into your application.
    have fun,
    anton

  • How to use the same services-config for the local and remote servers.

    My flex project works fine using the below but when I upload my flash file to the server I doesn't work, all the relative paths and files are the same execpt the remote one is a linux server.
    <?xml version="1.0" encoding="UTF-8"?>
    <services-config>
        <services>
            <service id="amfphp-flashremoting-service"
                class="flex.messaging.services.RemotingService"
                messageTypes="flex.messaging.messages.RemotingMessage">
                <destination id="amfphp">
                    <channels>
                        <channel ref="my-amfphp"/>
                    </channels>
                    <properties>
                        <source>*</source>
                    </properties>
                </destination>
            </service>
        </services>
        <channels>
        <channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="http://localhost/domainn.org/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>
        </channels>
    </services-config>
    I think the problem  is the line
            <endpoint uri="http://localhost/domainn.org/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
    but I'm not sure how to use the same services-config for the local and remote servers.

    paul.williams wrote:
    You are confusing "served from a web-server" with "compiled on a web-server". Served from a web-server means you are downloading a file from the web-server, it does not necessarily mean that the files has been generated / compiled on the server.
    The server.name and server.port tokens are replaced at runtime (ie. on the client when the swf has been downloaded and is running) not compile time (ie. while mxmlc / ant / wet-tier compiler is running). You do not need to compile on the server to take advantage of this.
    Hi Paul,
    In Flex, there is feature that lets developer to put all service-config.xml file configuration information into swf file. with
    -services=path/to/services-config.xml
    IF
    services-config.xml
    have tokens in it and user have not specified additional
    -context-root
    and this swf file is not served from web-app-server (like tomcat for example) than it will not work,
    Flash player have no possible way to replace token values of service-config.xml file durring runtime if that service-config.xml file have been baked into swf file during compilation,
    for example during development you can launch your swf file from your browser with file// protocol and still be able to access blazeDS services if
    -services=path/to/services-config.xml
    have been specified durring compilation.
    I dont know any better way to exmplain this, but in summary there is two places that you can tell swf  about service confogiration,
    1) pass -services=path/to/services-config.xml  parameter to compiler this way you tell swf file up front about all that good stuff,
    or 2) you put that file on the webserver( in this case, yes you should have replacement tokens in that file) and they will be repaced at runtime .

  • How to bind a UI element to the context

    Hi Experts,
               I have a problem binding UI element to the context. In my code i have to create TabStrips dynamically and under this tabstrip number of UI elements would be there. For this i have a code like this..
    IWDTransparentContainer theActionContainer =(IWDTransparentContainer)view.getElement("RootUIElementContainer");
         IWDTabStrip ts = (IWDTabStrip) view.createElement(IWDTabStrip.class,"TabStrip");
              IWDTab tab1 = (IWDTab) view.createElement(IWDTab.class,"Tab1");
              IWDInputField in = (IWDInputField) view.createElement(IWDInputField.class,"in");
              IWDCaption header1 = (IWDCaption) view.createElement(IWDCaption.class,"Header1");
              header1.setText("Tab1");
              tab1.setContent(in);
              ts.addTab(tab1);
              IWDTab tab2 = (IWDTab) view.createElement(IWDTab.class,"Tab2");
              IWDInputField in2 = (IWDInputField) view.createElement(IWDInputField.class,"in2");
              IWDCaption header2 = (IWDCaption) view.createElement(IWDCaption.class,"Header2");
              header2.setText("Tab2");
              tab2.setHeader(header2);
              ts.addTab(tab2);
              theActionContainer.addChild(ts);
    <b>when i run this code it is giving following exceptions..</b>
    The initial exception that caused the request to fail, was:
       com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Property 'value' of AbstractInputField with id 'in' in view 'LoginView' must be bound to the context
        at com.sap.tc.webdynpro.clientserver.uielib.standard.impl.AbstractInputField.getValue(AbstractInputField.java:1260)
        at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.InputFieldAdapter.getValue(InputFieldAdapter.java:582)
        at com.sap.tc.ur.renderer.ie6.InputFieldRenderer.render(InputFieldRenderer.java:56)
        at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:435)
        at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:134)
        ... 63 more
    com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Property 'value' of AbstractInputField with id 'in' in view 'LoginView' must be bound to the context
         at com.sap.tc.webdynpro.clientserver.uielib.standard.impl.AbstractInputField.getValue(AbstractInputField.java:1260)
         at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.InputFieldAdapter.getValue(InputFieldAdapter.java:582)
         at com.sap.tc.ur.renderer.ie6.InputFieldRenderer.render(InputFieldRenderer.java:56)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:435)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:134)
         at com.sap.tc.ur.renderer.ie6.TabStripRenderer.renderTabStripItemContentFragment(TabStripRenderer.java:1867)
         at com.sap.tc.ur.renderer.ie6.TabStripRenderer.renderTabStripFragment(TabStripRenderer.java:838)
    From these exceptions what  i understood is, i need to bind these UI elements to context.
       Can any body tell me how to bind a UI element to the context if I understood the exceptions correct..
    Thanks in Advance,
    Murthy.

    HI,
    lets say Ctx is your context attribute,
    IWDAttributeInfo attrInfo = wdContext.getNodeInfo.getAttribute("Ctx");
    then , as per your code,
    IWDInputField in = (IWDInputField) view.createElement(IWDInputField.class,"in");
    <b>in.bindValue(attrInfo);</b>
    if your contex attribute is child of some other node then do like this,
    IWDAttributeInfo attrInfo = wdContext.getNodeInfo.getChildNode("SalesOrder",0)getAttribute("Ctx");
    //this is when Ctx is child of node SalesOrder, and we are taking Ctx from its 0th element
    then ,
    IWDInputField in = (IWDInputField) view.createElement(IWDInputField.class,"in");
    <b>in.bindValue(attrInfo);</b>
    include this in your code ,
    let me know if you face any problem
    regards
    reward points if it helps

  • Sample PHP Service selecting from multiple tables

    Hi all!
    I have the following challange:
    How do I properly set up my PHP-service to insert, select, update and delete values from multiple tables?
    So far, the standard templates generated by Flash Builder is based on a single table.
    Example: I have 2 tables: [person] and [school]
    [person] has [person_id, first_name, last_name, birthdate]
    [school] has [school_id, person_id, school_name, city]
    One [person] can have multiple [schools]
    How should I define the selectByID function in PHP to be able to have
    First name: [TextInput /]
    Last name: [TextInput /]
    Birthdate: [DateField /]
    Schools:
    [TabBar: School1, School2, School3 /]
    [ViewStack1]
    School name: [TextInput /]
    Location name: [TextInput /]
    [/ViewStack1]]
    [ViewStack2]
    School name: [TextInput /]
    Location name: [TextInput /]
    [/ViewStack2]]
    [ViewStack3]
    School name: [TextInput /]
    Location name: [TextInput /]
    [/ViewStack3]]
    And even more interesting: How do I update all these fields back to the database?

    First, the relationship between school and person is many-to-many NOT one-to-many -- you will need to add a junction table.
    From the form you have given I would handle insertions like this:
    loop through all the schools and see if the school already exist in the DB. If so, then store the school_id. If not, then create a new record and store the id. You should have an array collection of store_ids by the end of the loop
    Check whether the student exists w/in the DB. If so, then you might consider aborting the operation or you could opt to do an update. If the student doesn't exist, then create a new student record and store the new student_id (mysql::insert_id)
    Loop through the school_id array and add new student_id/school_id records into the junction table.
    Retrieving records is much simpler -- it's just a join on the tables i.e. "SELECT * FROM student INNER JOIN school_student ON student.student_id = school_student.student_id INNER JOIN schools ON school_student.school_id = school.school_id WHERE student.first_name = 'John' AND student.last_name = 'Doe' (assuming there aren't more than one John Does of course!).
    - e

  • Access MySQL Database on Server with PHP Services

    Hi there
    There are lots of tutorials on how to connect to a MySQL database on your local machine but I'd like to access a database on my server.
    When creating a new Flex Project the wizard asks me to define a Web root and a Root URL. I used '/home/ecoflexer/public_html' as Web root and 'http://ecoflexer.com' as Root URL. However, the Web root coudn't be validated. So I've chosen the local folder 'C:\ecoflexer' as Web root. Though it was possibly wrong Flash Builder generated a debug folder at the defined location. After that I went to "Connect to Data/Service" and selected "PHP Service". I tried to generate a sample using the same credentials I use for a standard PHP login script ("Server Port" was left empty). After clicking on "Connect to Database" Zend was installed and returned an error. 'gateway.php' couldn't be found on 'http://ecoflexer.com/testProject-debug/gateway.php'.
    So I went into my local Web root and copied the 'testProject-debug' folder to my server to the destination the previous error mentioned. Then another error occured concerning a Zend file. So I went back and copied the whole 'ZendFramework' folder as well to my server. It connects now successfully to my database. I can chose a table but soon after that the introspection of the service fails. I modified the 'amf_config.ini' by adding 'webroot =/home/ecoflexer/public_html' and 'zend_path =/home/ecoflexer/public_html/ZendFramework/library' but it's still not working. Anithing I've done wrong or forgot to do?
    Cheers!
    ecoFLEXER

    iam doing client server application,the database is on the server,and iam doing the log in part,so i need to access the database to match the entered user name and password?so i should implement the accessing database part on the server side with the above code,right?i didn't test that i will test it now,but i thought that it's a different way

  • How to Call a porxy service(not WSDL based) in Bpel

    Hi ,
    I have requirement like, i need to call a proxy service in Bpel, to pass the customer data to the proxy.
    this proxy Enqueue the data to AQ , after  en queue the Customer data to AQ,I need call  some other synchronous services for business requirement.
    How to pass the XML Data to the proxyService.
    Thanks
    Raja

    You can achieve it through an HTTP adapter.Drag an HTTP Binding to the Services section then select option of One Way or Request/Response, in the verb use POST and use XML in the payload Type use xml.
    Best Regards,
    Anish Pathadan

  • RE : How to bind to two interfaces

    Gabriel,
    You can advertise an environment on two ip addresses
    by using multiple IP addresses instead of one in
    FORTE_NS_ADDRESS. Specify the IP addresses separated by semicolon
    setenv FORTE_NS_ADDRESS ip1:5000;ip2:5010;ip3:5012
    You will also have to define FORTE_LOCATIONS to point
    to these IP addresses so that Forte runtime knows where
    to find the environment and services. In this case you
    will always use the socket number 0 to allow Forte to
    pick any available socket.
    Ajith Kallambella M.
    Subject: How to bind to two interfaces
    Hi!
    On one of our Solaris servers we are facing the problem that we have
    two
    network interface cards in it.
    And we would like to access Forte on it through both cards. (avoid
    unnecessary network traffic)
    As far as I understand Forte needs a fix IP address to bind to (thus
    bound to one card).
    I tried to use 0.0.0.0 as a jolly-joker for all cards, but failed.
    Has anybody an idea? Or is it a restriction?
    If so, does Forte plan to improve the product in this way?
    GA'BRIEL, A'kos ([email protected]) Fax: (+36-1) 4312-977
    UNIX & Internet consultant Phone: (+36-1) 4312-979
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    Get Free Email and Do More On The Web. Visit http://www.msn.com
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Hello
    I assume you want to create multiple instance of your class.
    Assuming that you class is NOT a singleton then simply repeat the CREATE OBJECT statement as many times as you need.
    TYPES: begin of ty_s_class.
    TYPES: instance   TYPE REF TO zcl_myclass.
    TYPES: end of ty_s_class.
    DATA:
      lt_itab      TYPE STANDARD TABLE OF ty_s_class
                     WITH DEFAULT KEY,
      ls_record  TYPE ty_s_class.
      DO 10 TIMES.
        CLEAR: ls_record-instance.
        CREATE OBJECT ls_record-instance.
        APPEND ls_record TO lt_itab.
      ENDDO.
    Regards
      Uwe

Maybe you are looking for