I think I've narrowed it down to the problem. Set Response Header
Content-Type is not resulting in the correct value sent back to the web
browser. The example below is from directly referencing the .a4d script in
the browser URL. If it makes any difference, in my code I'm normally calling
it from a javascript library using AJAX.

FF 3.6+ displays response headers as:

Server: 4D_v11_SQL/11.7.0
Date: Fri, 22 Oct 2010 21:34:59 GMT
Cache-Control: no-cache
Content-Length: 503
Content-Type: text/html; charset=windows-1252
Expires: Fri, 22 Oct 2010 22:34:59 GMT
Pragma: no-cache

200 OK
_____

Now I know that the response header for Content-Type should be "text/xml"
because I set the response headers and verify that it is being set by
crashing on the command and then allowing it to run correctly.

Active4D error
Source  Method  Line
/C/...../web/out_data_5.a4d     [main]  60
crash set response header("Content-Type";"text/xml")
Syntax error
Active4D 5.0r19 [Windows, release]
_____

The same failure happens when attempting to return a different Content-Type
for json data.
Server: 4D_v11_SQL/11.7.0
Date: Fri, 22 Oct 2010 21:48:11 GMT
Cache-Control: no-cache
Content-Length: 11672
Content-Type: text/html; charset=windows-1252
Expires: Fri, 22 Oct 2010 22:48:11 GMT
Pragma: no-cache

200 OK
_____
Active4D error
Source  Method  Line
/C/...../web/out_data_5.a4d     [main]  22
crash set response header("Content-Type";"application/json")
Syntax error
Active4D 5.0r19 [Windows, release]
_____

The resulting XML document follows. There are no spaces or other characters
preceding the XML.
<?xml version="1.0"?>
<rows>
<total_count>126</total_count>
<pos>1</pos>

<row id="6">
<cell>6</cell>
<cell>Elizabeth, Betty</cell>
<cell>555-8741</cell>
<cell>104</cell>
<cell>04/08/08</cell>

<cell>09/30/09</cell>
<cell>123-45-7894</cell>
<cell>11/12/1923</cell>
</row>

<row id="8">
<cell>8</cell>
<cell>Beckman, Tanya</cell>
<cell>(888) 555-9654</cell>
<cell>02</cell>

<cell>12/06/08</cell>
<cell>00/00/00</cell>
<cell>121-21-2121</cell>
<cell>01/02/1934</cell>
</row>

</rows>
__________

The resulting json document follows.
data={rows:[
{id:6,data:['6','Elizabeth,
Betty','555-8741','104','04/08/08','09/30/09','123-45-7894','11/12/1923']},
{id:8,data:['8','Beckman, Tanya','(888)
555-9654','02','12/06/08','00/00/00','121-21-2121','01/02/1934']},
{id:9,data:['9','Sample, Bob','(333)
654-6876','002','08/04/09','00/00/00','','01/01/1923']},
{id:146,data:['146','Jenkins,
Ryan','','721','12/14/09','00/00/00','','01/01/1934']}
]};
_____


David Ringsmuth

_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to