1 Reply Latest reply on Nov 12, 2011 11:44 AM by miguel8312

    Passing Multiple Values in a HTTPService Request

    MikePotratz Level 1

      I have a dataservice which calls an PHP file on my server.  In my service I have established 2 variables (id_facility & id_ownership) and a POST action to the PHP script.  The PHP script takes these two variables, queries the database and returns an XML file which I then display in a datagrid.


      In flash builder I can "test" the service while entering multiple variables and it returns the information just fine.


      I created the datagrid and dropped the dataservice onto it.  It them prompted me to provide the values for the two variables above.  I did.  Here is the resultant code:


      getSourceDocsResult.token = cloudInformation.getSourceDocs(id_facility, id_ownership);


      But - it will never populate the datagrid.  If I change the data service and remove the id_ownership variable, while hardcoding a test value in the php script) and just pass the id_facility variable, it works just fine.  To test, I can manually call the PHP script in a web browser and provide the variable and it returns the XML file just fine.  I've also tried changing the action from POST to GET with no effect.  It's like it ignores the second variable.


      Running in debug mode shows that the 2 variables are being set with correct values so that isn't an issue.


      So:  is the above code wrong?  I've tried searching all all examples, including documentation, only show 1 variable being passed. 


      Sign me "stumped".


      Any and all assistance, pointers, links, hints tips or free beer would be appreciated!

        • 1. Re: Passing Multiple Values in a HTTPService Request
          miguel8312 Level 3

          mike if you want to send more then one variable to the http://service written in php. You would do something like such.

          <s:HTTPService id="Todolistinsert"
                                 resultFormat="e4x" method="POST"
                      <s:request xmlns="">
                      <list>{Todo.text}  </list>

          in my case above im sending three variables and they are binded to components on my form.  then when you make the call you just simply do something like


          this should do the trick. post up here if you need anymore help.