Date:  06/17/2006 02:52:18 AM Msg ID:  002987
From:  Brent Roberts Thread:  002980
Subject:  Re: FoxWeb compliance with standards?
ASP.NET 2.0 complains that a protocol violation has occurred if I change the line to only use CHR(10) or CHR(13). I have to include both of them to avoid the error message.

-Brent

Sent by FoxWeb Support on 06/16/2006 07:03:04 PM:
FoxWeb uses single LF characters to separate HTTP headers, but this is legal.  It does not use single CR characters.  Could it be that ASP 2.0 Doesn't like LF characters?  Try changing your code to the following:
 
html_out = "Status: 200 OK" + CHR(10) + CHR(10) + Response.OutputBuffer

FoxWeb Support Team
support@foxweb.com email

Sent by Brent Roberts on 06/16/2006 12:09:29 PM:
As for sample scripts, all of my scripts are not publicly accessible, but even the simplest ones will cause ASP.NET 2.0 to complain when it tries to read the response.
<% Response.Write("Hello, world") %>

Your mention of html_out has led me to somewhat of a solution.

Adding the following line at the end of my FoxWeb scripts allows them to work correctly with ASP.NET 2.0:

         html_out = "Status: 200 OK" + CHR(13) + CHR(10) + CHR(13) + CHR(10) + Response.OutputBuffer
 
-Brent


Sent by FoxWeb Support on 06/16/2006 11:06:16 AM:
Ah, now I understand what you meant by ASP integration.  FoxWeb uses either CR LF, or just LF as newline characters in HTTP headers -- at least when these headers are created with the Response object.  As far as I know, both options are valid.
 
The error message indicates that the response header contains CR characters by themselves, which apparently ASP.Net 2.0 doesn't like.  I don't think this is possible with FoxWeb, but I may be wrong.  Do your FoxWeb scripts use html_out to return data, or do they use the Response object?
 
Also, are your FW scripts available over the Internet?  If they are, we can examine their response in a binary editor.

FoxWeb Support Team
support@foxweb.com email

Sent by Brent Roberts on 06/16/2006 07:00:48 AM:
I am using IIS 6, FoxWeb 3.3, and ASP.NET 2.0.50727. ASP.NET is the new web development model for my organization; however we have a large library of FoxWeb scripts that we would like to continue using rather than rewriting them.

The FoxWeb scripts perform black-box functions such as FoxPro database queries/updates, interface to third-party authentication systems, manage security lists, send e-mail notifications to distribution lists, etc. Calling these FoxWeb scripts from a web browser such as IE6, IE7, FireFox 1.5, or HTTP socket libraries from inside a FoxPro application all work fine. Everything works as expected with ASP.NET 1.1 web pages as well. It wasn't until ASP.NET 2.0 that the problems started occuring.

The code in the ASP.NET 2.0 pages that is breaking looks something like this:

req = HttpWebRequest.Create("http://dev.server/foxweb.fwx?form_id=notify&appcode=register")

resp = req.GetResponse()


Some people have suggested that I modify the web.config file for ASP.NET but this doesn't seem to work.
<system.net>
    <settings>
      <httpWebRequest useUnsafeHeaderParsing="true"/>
    </settings>
</system.net>


I realize this might be a bug in ASP.NET or a server misconfiguration that is unrelated to FoxWeb, but I'm curious if FoxWeb is indeed sending a CRLF after each of the response headers that it sends.

-Brent

Sent by FoxWeb Support on 06/15/2006 06:11:58 PM:
What do you mean by "interfacing with a FoxWeb script?"  Can you please describe your system?  Are you using ASP.Net scripts, or are you simply using a .Net-enabled version of IIS with FoxWeb?

FoxWeb Support Team
support@foxweb.com email

Sent by Brent Roberts on 06/15/2006 05:31:24 AM:
 I have a ASP.NET web page that is interfacing to a FoxWeb script. Starting with ASP.NET 2.0, I am now getting this error message from the ASP interpreter, regardless of the FoxWeb script being called:

The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF


From what I can tell, ASP.NET 2.0 is now enforcing more stringent header tests, and this might be an issue with how FoxWeb is sending content back to the web server. Microsoft support suggested making inquiries about compliance with RFC 822 and 2616.

Any help you can give would be appreciated.

Thanks.