Peter, We've installed TamperData for Firefox and we've done some extensive testing with it to see if the special characters exist in the HTTP responses. We have been unable to reproduce the problem there. We have tried setting the content length header accurately based on the data the servlet spits out. We have also checked the other items you suggested and they appear to be fine... we are actually just generating a string of XML manually, there is no XML document in the equation.
At this point we are wondering what the possibility is that the HTTPService (or URLLoader) has problems handling chunked data? Is there a maximum length that the HTTPService/ URLLoader can handle for an XML document? Our average document is sitting at around 500 lines of XML. Thanks again for your assistance with this issue, Brian --- In [email protected], "Peter Farland" <[EMAIL PROTECTED]> wrote: > > You could use an HTTP sniffer to prove that the content is coming from your > servlet. As for a cause, I would look at the code writing to the response stream, whether you're flushing the buffer when you're finished, whether you're writing to the stream using a different encoding, whether you're swallowing any unexpected exceptions, whether the content length reported is accurate, etc. Also I'm guessing that you're converting your XML Document to a String before serializing it in the response... I'd check this output before it returns too. > > ________________________________ > > From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of klumikaze > Sent: Tuesday, March 06, 2007 9:56 AM > To: [email protected] > Subject: [flexcoders] Re: Special characters after end tag of XML document > (HTTPService issue) > > > > Thanks Peter > > I have implemented the URLLoader method as suggested, and unfortunately I am > still > experiencing the same issues. > > I'm really starting to think this could be on the Java end of things -- > anybody have any > insight there? We have set the character encoding of the servlet to UTF-8 > explicitly, and we > have the content type set to text/xml. > > Thoughts? > > Thanks, > > Brian > > --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , > "Peter Farland" <pfarland@> wrote: > > > > If you're not using the proxy, then HTTPService is ultimately using flash.net.URLLoader > to load and receive the data. You could try to take Flex out of the equation > for a second > and try the raw URLLoader API to see if it still occurs there. > > > > > > ________________________________ > > > > From: [email protected] <mailto:flexcoders%40yahoogroups.com> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> ] On Behalf Of > Brian Dunphy > > Sent: Monday, March 05, 2007 3:29 PM > > To: [email protected] <mailto:flexcoders%40yahoogroups.com> > > Subject: Re: [flexcoders] Special characters after end tag of XML document (HTTPService > issue) > > > > > > > > Peter, > > > > I have not made any changes to the XML.ignoreWhitespace property. > > > > I have implemented the trim as suggested, and I have also put a check > > to see if the last character of the string is a > (a quick way to see > > if there's trailing junk characters). > > > > What I'm experiencing now is the same issue as before, however now I > > can see the trailing characters traced in my flashlog. Just as a > > sample, `á!àê!àî!`á! ï! appears at the end of one of them. > > > > I have noted that we are experiencing this with more than one servlet > > at this point, it appears that all of the servlets in our application > > might be affected. > > > > Any other thoughts/suggestions? > > > > Thanks again, > > > > Brian > > > > On 3/5/07, Peter Farland <pfarland@ <mailto:pfarland%40adobe.com> > wrote: > > > > > > > > > > > > > > > > > > > > > > > > Perhaps your special characters trailing the document are whitespace > > > (tabs, > > > new lines, etc)? > > > > > > There are known issues with constructing an XML instance (the basis for > > > E4X) > > > from Strings containing whitespace between processing instructions and the > > > start of the root element (or trailing whitespace after the root element) > > > and with XML.ignoreWhitespace set to false. > > > > > > Have you by any chance set XML.ignoreWhitespace to false? > > > > > > If so, for your particular scenario of trailing special characters you > > > could > > > keep HTTPService's resultFormat as "text" to get it as a raw String, then > > > use mx.utils.StringUtil.trim() on the String, and then construct a new XML > > > instance from your String new XML(result). > > > > > > > > > ________________________________ > > > From: [email protected] <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%40yahoogroups.com> > [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%40yahoogroups.com> ] On > > > Behalf Of klumikaze > > > Sent: Monday, March 05, 2007 2:40 PM > > > To: [email protected] <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%40yahoogroups.com> > > > Subject: [flexcoders] Special characters after end tag of XML document > > > (HTTPService issue) > > > > > > > > > > > > > > > > > > I've got an E4X HTTPService in Flex that is calling a servlet which > > > returns > > > an XML > > > document. Approximately 80% of the time, the servlet works fine and the > > > HTTPService > > > result is a valid XML doc -- the rest of the time, the HTTPService is > > > giving > > > me a fault: > > > > > > [RPC Fault faultString="Error #1088: The markup in the document following > > > the root > > > element must be well-formed." faultCode="Client.CouldNotDecode" > > > faultDetail="null"] > > > > > > After taking a look at the servlet directly in the browser (removing Flex > > > from the equation), > > > I have not noticed any issue with the XML returned and we have run it > > > through several > > > online validation tools. The servlet code that generated the XML is fine > > > as > > > well, we have > > > checked that numerous times. > > > > > > I thought that the problem might be the resultFormat of the HTTPService > > > (currently E4X), > > > so I changed it to 'text' so I could see if there was any special > > > characters > > > or issues with the > > > XML after Flex called the servlet. I discovered that there are seemingly > > > random special > > > characters being appended to the end of the document (after the end tag). > > > The string of > > > random special characters ranges from 2-10 in length. > > > > > > Note: I have since put the resultFormat of the HTTPService back to e4x. > > > > > > Does anybody have any idea why this might be happening? We have observed > > > this on > > > Windows, OS X and Ubuntu Linux platforms, in IE7, Safari, Firefox (Mac) > > > and > > > Firefox > > > (Ubuntu). > > > > > > Thanks for your help, > > > > > > Brian > > > > > > > > > > > > > > > > -- > > Brian Dunphy > > >

