Please send an HTML example that sends the data correctly and we can
look into trying something similar.  But I'm not sure that nested
parameter values is allowed in the www-form-urlencoded
transfer-encoding.  If you go look at the J2EE API for reading
parameters, you can only have string values returned, nothing complex.
What transfer-encoding was your application that worked successfully
using?

It may be that we can adjust HTTPService so that if you specify the
method as POST and pass us just a String as parameters you can do your
own object encoding and we'll send it for you.  We can also look into
opening up the contentType property so it isn't limited to form and xml.

If you send me more details of how your server was implemented I can
write up the ECR.

Matt


-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Mark Wales
Sent: Tuesday, January 31, 2006 11:40 PM
To: [email protected]
Subject: RE: [flexcoders] Re: Using HTTPService to POST complex data


Alaric,

I agree that simple types are only supported - the docs you identify,
Matt's comments, and my own trial-and-error support that conclusion. 

My challenge is that the default operation of the server-side
application I am trying to communicate with uses the nested form. While
in my specific case, I might be able to change the way this works, it
seems that it should not be too much to ask for Flex to be able to fully
support what is a valid HTTP construct. 

Interestingly, I know of at least one vendor that defined a class to map
seamlessly between a Java data structure and complex HTTP data and made
it part of their core APIs. Being able to create a (potentially
recursive) hash table worked extremely well and allowed the use of
arbitrary depth and hence arbitrarily complex data. Having used this
form to stuff highly nested structures like EDI and similar
business-to-business documents into HTTP, I can attest that something
similar in ActionScript could be extremely useful. Unfortunately, at
present it does not appear that the current limitations can be resolved
by anyone outside Macromedia.

-Mark


-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of alariccole
Sent: Monday, January 30, 2006 1:17 AM
To: [email protected]
Subject: [flexcoders] Re: Using HTTPService to POST complex data

The problem is the nested object category.name. You can only pass
simple variables, as they're converted to HTTP (e.g.
name=Test&commit=Create). As taken from the FB help file:

"When you use explicit parameter passing, you can specify an object
that contains name-value pairs as a send() method parameter. A send()
method parameter must be a simple base type; you cannot use complex
nested objects because there is no generic way to convert them to
name-value pairs."

So just change it to something like:
<mx:request>
   <categoryName>Test</categoryName>
   <commit>Create</commit>
</mx:request>

-Alaric


--- In [email protected], "Peter Farland" <[EMAIL PROTECTED]>
wrote:
>
> Have you tried moving your custom values as the child tags of
> <mx:request> to the same namespace by prefixing them with mx:   ?
> Alternatively, have you assigned an id to your HTTPService and then
used
> script to set the request property to an anonymous Object that
contains
> the properties that you want to POST?
> 
> What do you have set for the contentType? The default should be
> "application/x-www-form-urlencoded" which is what you'd want for a
form
> submission.
> 
> Pete
> 
> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED]
On
> Behalf Of stuff
> Sent: Saturday, January 28, 2006 9:18 AM
> To: [email protected]
> Subject: [flexcoders] Using HTTPService to POST complex data
> 
> 
> I am trying to emulate an HTML form submission with HTTPService and I
> seem to be missing something on the construction of the associated
> request. From the server log of a successful POST I have the
following:
> 
> [POST]  Parameters: {"commit"=>"Create", "category"=>{"name"=>"Test"},
> ...}
> 
> At present, my request looks like this:
> 
>       <mx:request>
>               <category><name>Test</name></category>
>               <commit>Create</commit>
>         </mx:request>
> 
> ...But that generates a runtime error. I have tried multiple
constructs
> (Arrays, ActionScript, etc.) but I've not been able to hit on the
right
> solution. 
> 
> Does anyone have any suggestions?
> 
> Thanks,
> 
> -Mark
> 
> 
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>










--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links



 







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links



 




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to