title: HTTP/1.1 500 Complex object types cannot be converted to simple values
body: <p>I'm following a <a href="http://www.bennadel.com/blog/1498-ask-ben-cross-site-ajax-requests-using-jquery-and-coldfusion.htm" rel="nofollow">tutorial</a> by Ben Nadel and I am receiving the following error in browser Network/XHR. </p>
  
  <p><strong>Complex object types cannot be converted to simple values</strong></p>
  
  <p>I think the problem is in the CFLoop tag but I'm not sure exactly what I should modify to resolve the error.</p>
  
  <pre><code>&lt;!---
      Get the content as a byte array (by converting it to binary,
      we can echo back the appropriate length as well as use it in
      the binary response stream.
  ---&gt;
  &lt;cfset binResponse = ToBinary(ToBase64( objRequest.FileContent )) /&gt;
  
  &lt;!--- Echo back the response code. ---&gt;
  &lt;cfheader statuscode="#Val( objRequest.StatusCode )#" statustext="#ListRest( objRequest.StatusCode, ' ' )#" /&gt;
  
  &lt;!--- Echo back response legnth. ---&gt;
  &lt;cfheader name="content-length" value="#ArrayLen( binResponse )#" /&gt;
  
  &lt;!--- Echo back all response heaers. ---&gt;
  &lt;cfloop item="strKey" collection="#objRequest.ResponseHeader#"&gt;
  
  &lt;!--- Check to see if this header is a simple value. ---&gt;
      &lt;cfif IsSimpleValue( objRequest.ResponseHeader[ strKey ] )&gt;
  
          &lt;!--- Echo back header value. ---&gt;
          &lt;cfheader name="#strKey#" value="#objRequest.ResponseHeader[ strKey ]#" /&gt;
      &lt;/cfif&gt;
  
  &lt;/cfloop&gt;
  
  &lt;!---
      Echo back content with the appropriate mime type. By using
      the Variable attribute, we will make sure that the content
      stream is reset and ONLY the given response will be returned.
  ---&gt;
  &lt;cfcontent type="#objRequest.MimeType#" variable="#binResponse#" /&gt;
  </code></pre>