ERROR ON LINE 1: CONTENT IS NOT ALLOWED IN PROLOG.
I am working on a small flex application that sends XML to the server using <mx:httpservice />. The server then responds with a bit of XML for my manipulation. I keep getting an error form the server stating the XML is not well formed. If I trace the XML before I send it, it shows up fine in the debug window. No spaces, carriage returns or anything before the XML declaration (which from what I have read,is usually the cause of the error "Content is not allowed in prolog".
As you can see in the image, the XML declaration does not appear to have anything preceding it...
Has anyone run into this in the past? Have any suggestions? I'd greatly appreciate it!

"If the generated content is, say, XML delivered via CFCONTENT then the XML will have the unclosed META tag as a watermark which breaks the well-formedness of the XML document."
More info at: http://www.talkingtree.com/blog/index.cfm/2005/6/1....
Hope this helps you save some sanity. :-)
http://kevinlangdon.com/serviceCapture/
Well there's your problem, you accidentally ran a Prolog interpreter instead of the MXML compiler.
The Prolog error is coming from another server that is processing the submitted xml... it has nothing to do with mxml.. I'm running the stuff straight outta flex builder.. outta the box.. so hopefully I haven't muffed anything up on my end.. *shrug*
The xml is not well formed can be caused by the xml not being well formed obviously or not getting any data whatsoever. See this post: http://www.judahfrangipane.com/blog/?p=95
In the httpservice call change the resultType to text instead of xml or e4x and trace out the value. Also, using Service Capture like another poster stated can help save hours.
http://codeshare.ulatu.com/mara01b4
Mind you, I was /not/ able to do it using <mx:httpservice />
I was able to do it using the following:
http://codeshare.ulatu.com/mar47ca4
Thanks for all the help!
In your original code change this:
# < mx:request xmlns="">
# {str}
# < /mx:request>
to this:
# < mx:request>{str}</ mx:request>
note: i added the spaces so the markup would show up
flex takes child node contents that are strings literally. it does nothing with the data so it is sending exactly what you want it to.
public function requestItems():void {
var xmlStr:String = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><doc><first>testing</first></doc>";
var xml:XML = new XML(xmlStr);
var itemXML:HTTPService = new HTTPService();
itemXML.contentType = "application/xml";
itemXML.method = "POST";
itemXML.addEventListener(ResultEvent.RESULT, handleResults);
itemXML.addEventListener(FaultEvent.FAULT, handleError);
itemXML.url = "http://localhost:8080/tomcat_app/";
itemXML.send(xmlStr);
}
itemXML.send(xml);
In the send method, it needs to be an XML object, not a String object.
http://www.china-lapelpin-center.com/
http://www.storeconcept.com.hk/
http://www.metroasia.com.hk/
http://www.metroparkhotelmongkok.com/
http://www.ngayinacupuncturehk.com/
http://www.queenaflorist.com/
http://www.raypartners.com.hk/
http://www.regallogistics-hk.com/
http://www.transocean-group.com/
http://www.simplestorage.com.hk/
http://www.hk-office-furniture.com
http://www.lucky-int.com/
http://www.in-fashion.com.hk/Fashion-jewelry-whole...
http://www.in-fashion.com.hk/Infashion-fashion-jew...
http://www.in-fashion.com.hk/Earring-necklace-Whol...
http://www.in-fashion.com.hk/Online-accessories.ht...
http://www.in-fashion.com.hk/Jewelry-online-shop.h...
http://www.in-fashion.com.hk/Fashion-jewellery-who...
http://www.in-fashion.com.hk/Fashion-wholesale.htm...
[url=http://www.toy-match.com]Toy stores for RC Tank,RC Bearing,Radio Control[/url]
[url=http://www.toy-match.com/rctanks.html" target="_blank">http://www.toy-match.com/rctanks.html]RC Tank[/url]
[url=http://www.toy-match.com/tomy+tomica.html]Tomica[/url]
[url=http://www.toy-match.com/choroq.html]Choro-Q[/url]
[url=http://www.toy-match.com/futaba.html]Futaba[/url]
[url=http://www.toy-match.com/tamiya.html]Tamiya[/url]
[url=http://www.toy-match.com/ebbro.html" target="_blank">http://www.toy-match.com/ebbro.html]Ebbro[/url]
[url=http://www.toy-match.com/tank.html" target="_blank">http://www.toy-match.com/tank.html]Tiger I[/url]
[url=http://www.toy-match.com/tomy+tomica.html]Tomy[/url]
[url=http://www.toy-match.com/miniz.html]Mini-Z[/url]
[url=http://www.toy-match.com/futaba.html]Radio Control[/url]
[url=http://www.toy-match.com/rc_bearing.html" target="_blank">http://www.toy-match.com/rc_bearing.html]RC Bearing[/url]
[url=http://www.toy-match.com/minichamps.html]Minichamps[/url]
[url=http://www.toy-match.com/silverlit.html]Silverlit[/url]
[url=http://www.toy-match.com/kyosho.html" target="_blank">http://www.toy-match.com/kyosho.html]Kyosho[/url]
[url=http://www.toy-match.com/ixo.html]IXO[/url]
I use your code for my web: http://www.chinayujie.com