Monday, March 16, 2009

Flex HTTP Service result formatting

when playing around with the flex HTTPService class, i got the following error:

faultCode:Client.CouldNotDecode faultString:'Error #1090: XML parser failure: element is malformed.' faultDetail:'null'

this is because i was using the default parser (i.e. “object”) for the result digestion, while the returned value from my HTTP hit was HTML.

all this is clearly explained in the adobe documentation for the HTTPService, but not that clear from the error.

when connecting to a site or external data source with an unknown structure, its easier to analyze the incoming stream when the result format is set to “text”. this returns the stream in its raw form.

the property is set as follows:

myHTTPService.resultFormat="text";

No comments:

Post a Comment

Please do not post spam on this blog, Spam sites will be reported to google.
thank you kindly.