The first thing you should do is create an html form and post to a perl file. If you cant do that you cant do it form flex.
Thanks for the reply and suggestion. I did that before starting in Flex, the HTML form works perfectly.
An update... I tried converting all the values to strings and this time I am at least getting a faultEvent response. I'll see if I can figure out what it means.
This keeps getting more strange. It did start sending a result back that I was able to review in debug mode. However, the Perl script was only seeing part of the parameters, and misreading some of the ones it did see. For example, out of 9 parameters, it saw only 3, and one of them - the year - it misread. I submitted 2009 for the year, and it picked it up as 2001.Other times posting identical parameters it just choked.
I have tried defining the POST parameters in Actionscript in an object, like:
var objPerlScript_Params:Object=new Object; objPerlScript_Params.item1=2; objPerlScript_Params.itemb="something"; etc... servicePerlScript.send(objPerlScript_Params);
I also made a static request definition in MXML, with the same result.
My last attempt last night was to try cURL in PHP. It worked perfectly on the first try.
$ch = curl_init(); // initialize curl handle . . . curl_setopt($ch, CURLOPT_POST, 1); // set POST method curl_setopt($ch, CURLOPT_POSTFIELDS, "item1=2&itemb="something"); // add POST fields $result = curl_exec($ch);
My only theory at this point is that something in the way Flex formats the POST data is incompatible with the old Perl script. I wonder if it uses some old encoding type that is incompatible with Flex's default "application/x-www-form-urlencoded" ??
So I guess I'll be building this solution in PHP, then pass the finished data in XML to my Flex app. I was hoping to avoid that extra step. Hopefully posting this workaround can help someone else out there.