-Andy
Probably the returned xml is malformed. ;)
Seriously, call the HTTPService url directly from a browser. What you get back will probably show the problem.
Ah, also, I am not sure that adding querystring data to the url is supported. Instead, put your data into a request object and then call the naked url. This way you can use POST, which can carry more data, more securely, and with less issues with escaping.
It is partially supported. I found this in the docs:
url
url: String
Location of the service. The specified URL should not contain any query parameters (? followed by name/value pairs), unless the HTTP method is GET and the<mx:HTTPService>tag contains no request parameters. Currently you can only add parameters to the URL if you set it through ActionScript, not the tag. Use either theurlproperty or theserviceNameproperty, not both.
Still, it is an ugly way to do it. Use the request Object.
var sReqParam:String = "SEL_EVENT" + sWhatever;
var oRequest:Object = new Object({sql: sReqParam })
eventHTTP.send(oRequest );
Tracy
From: [email protected] [mailto:[email protected]] On Behalf Of Andrew D, Goodfellow
Sent: Friday, December 30, 2005 1:30 AM
To: [email protected]
Subject: [flexcoders] Flex 1.5 HTTPService Fault: An XML element was malformed
Does anyone know why when I run this code I get an error that says: "HTTPService Fault: An XML element was malformed."? It seems to only happen when I escape things like & and # into the URL.--
<?xml version=" 1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
<mx:HTTPService id="eventHTTP" url=""
<mx:Script>
<![CDATA[
function HTTPServiceErrorTest():Void {
var myEscapedStuff:String = escape("&");
eventHTTP.url = "" href="http://127.0.0.1/intranet?sql=SEL_EVENT" target="_blank" > http://127.0.0.1/intranet?sql=SEL_EVENT "+myEscapedStuff;
eventHTTP.send();
}
]]>
</mx:Script>
<mx:Button label="Button" click="HTTPServiceErrorTest()"/>
</mx:Application>
TIA
-Andy
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
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service .
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
| Web site design development | Computer software development | Software design and development |
| Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

