Ah, I believe HTTPService does a for..in loop over the parameters, and if you use a strongly typed class the for..in won’t return anything.  Then when you try to send no parameters to a POST request it will be turned into a GET by the Player.

 

We should make sure that’s mentioned in the docs (or look into changing that behavior…).

 

Matt

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of James Polanco
Sent: Wednesday, August 23, 2006 6:53 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] AS HTTPService ignoring method propety

 

Hey all,
I am using the ActionScript HTTPService and I found an issue with it.
I feel its a bug, but I may have been "misusing" the functionality
and I got away with it until I pushed too far. Here is the problem/issue:

I have a JSP app that I am calling via HTTP that returns XML data.
One of the services requires that the data comes in via POST and not
GET. No biggie, just set the method propert... or so I thought.

When I called the app it kept coming back with "" and after looking at
the HTTP headers we realized it was always coming in as a GET even
though I explicitly set it to POST. This is where things started to
get odd... some of my service calls (all routed through the same
service code) came out as POSTs and some as GETs.

I was able to track down the cause and it was all based around the
format of the object that I was passing to the request property. For
example, if I did it this way my call became a POST (as desired)

myService.request = {zip: "94103};

If I created a custom VO class that had public properties that matched
the required parameters it converts to GET on the call(protocode):

class MyZipVO
{
public var zip:String = "94103";
}

----

var temp:MyZipVO = new MyZipVO();
myService.request = temp;

I didn't catch this at first because my previous services worked as
either GET or POST but once I tried to access the one that required
POST it all blew up. Anyway, I figured it out and I can work around
it, but any idea on why this fails or if this should work in the first
place?

James

__._,_.___

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





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to