Skip to main content
Inspiring
February 25, 2011
Question

CFCONTENT and XML strange problem

  • February 25, 2011
  • 1 reply
  • 1373 views

I've written a page in cold fusion that returns XML.  It works great.  In my development environment CF8 developer's version on my Windows XP desktop it's great.  On a development server running CF8 on BEA it works great.  On another development server running CF7 on BEA it seems as if my tag <cfcontent type="text/xml" reset="YES"> is being ignored.  Running the app in Firefox the content type is always being returnes as "text/html".  In my CF7 environment, I looked in the "Security -> Sandbox Security" settings to see if anything is set up there for cfcontent and it looks great there also.  Any clues from the knowledgable folks here?  Thanks in advance if you've see this before!

    This topic has been closed for replies.

    1 reply

    Inspiring
    February 25, 2011

    I would find out if the BEA server rewrites HTTP headers.  If the code is the same perhaps there is a difference in how BEA serves HTTP requests vs your local dev server.

    A sample of your code would also help in troubleshooting your issue.

    Message was edited by: JR "Bob" Dobbs

    phammAuthor
    Inspiring
    February 28, 2011

    Thank you JR for your time thinking about my problem.  I appreciate it!  Hope you have some nice quality tobbaco for your pipe.

    Strange that on the BEA server hosting Cold Fusion 8 I have no problem.  It's only on the BEA server hosting Cold Fusion 7.

    I am using the function

    <cfcontent type="text/xml" reset="YES">

    to set the content to text/xml, and simply outputting my variables in XML that I'm authoring, such as the following:

    <var_date>#DateFormat(return_query.var_date, "yyyy-mm-dd")#</var_date>

    It's actually very simple stuff.  I'm not using any of the Cold Fusion xml functions, just simply writing XML just as I would write HTML for a web page.  The XML is all valid and works great.

    Inspiring
    February 28, 2011

    Does your output include the XML declaration? If not, perhaps adding one might make a difference.