The problem with getting no data through is because you're using a
non-dynamic object. Use:
var params : Object =
{
paramName: paramValue,
param2Name: param2Value
};
The reason is that the service code uses something like:
for(var key:* in params)
{
request.addParam(key, params[key]);
}
And doesn't use reflection.
Fixed fields (those defined in non-dynamic classes) don't show up in for-in
loops.
More info:
http://livedocs.adobe.com/flex/3/langref/statements.html#for..in
http://livedocs.adobe.com/flex/3/langref/statements.html#for_each..in
-Josh
On Fri, Jul 18, 2008 at 5:00 AM, Tracy Spratt <[EMAIL PROTECTED]> wrote:
> To repeat, sending data to the server using the default contentType with
> name=value pairs in a standard Object is easy. Do you have a reason to look
> for a different way? The UI and bindings should not be relevant to this
> issue.
>
> Tracy
>
>
> ------------------------------
>
> *From:* [email protected] [mailto:[EMAIL PROTECTED] *On
> Behalf Of *pbrendanc
> *Sent:* Thursday, July 17, 2008 2:17 PM
> *To:* [email protected]
> *Subject:* [flexcoders] Re: HTTP Service Send Requests with Parameter
> Object - 405 Errors?
>
>
>
> Since I'm not binding the data to any visible fields i want to handle
> this in as - so I'd like to understand what does/doesn't work using as -
> I like to use code behind as much as possible.
>
> BTW - I did resolve my 405 error as an IIS issue - however I'm not
> seeing the data defined in my parameter object in the http request (on
> the server side). (I'll post a separate message on this)
>
> Patrick
>
> --- In [email protected] <flexcoders%40yahoogroups.com>, "Tracy
> Spratt" <[EMAIL PROTECTED]> wrote:
> >
> > This is trivial with a normal mx:Object. Are you committed to sending
> a
> > custom object?
> >
> >
> >
> > Tracy
> >
> >
> >
> > ________________________________
> >
> > From: [email protected] <flexcoders%40yahoogroups.com> [mailto:
> [email protected] <flexcoders%40yahoogroups.com>]
> On
> > Behalf Of pbrendanc
> > Sent: Wednesday, July 16, 2008 5:44 PM
> > To: [email protected] <flexcoders%40yahoogroups.com>
> > Subject: [flexcoders] HTTP Service Send Requests with Parameter Object
> -
> > 405 Errors?
> >
> >
> >
> > The Flex docs specify that the send object can contain either
> Name/Value
> > pairs of an XML object but I keep getting errors.
> > Is it possible to pass a (non null) parameter object in the HTTP
> service
> > send request - I keep getting HTTP405 (Method not allowed) errors. (If
> > I include these args as part of the query string everything works as
> > expected).
> >
> > (BTW - I'm using IIS - so is it possible that I need to change some
> IIS
> > settings?)
> >
> > // Define test object
> >
> > public class dummyobj
> > {
> > public var f1:String;
> > public var f2:String;
> > }
> >
> > public function useHttpService(parameters:Object):void {
> >
> > var httpSvc = new HTTPService();
> > httpSvc.url= "http://localhost:8080 <http://localhost:8080> ";
> > httpSvc.method = "POST";
> > httpSvc.contentType = "application/x-www-form-urlencoded";
> > httpSvc.addEventListener("result", httpResult);
> > httpSvc.addEventListener("fault", httpFault);
> >
> > // Load request parameters into an object
> > // to send with the request
> > var testVO:dummyobj = new dummyobj();
> > testVO.f1 = "aaa";
> > testVO.f2 = "bbb";
> > httpSvc.send(testVO); // gets 405
> > error
> >
> > TIA,
> > Patrick
> >
>
>
>
--
"Therefore, send not to know For whom the bell tolls. It tolls for thee."
:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]