Hi,
After applying SP1 for Server 2008 R2 (or SP1 for Windows 7), we started to receive errors when using RadCompression.
The issue only occurs when calling web-services. The web-service call actually works but there is always an exception that is handled in Application_Error, and since we have centralized our error handling, an error is logged for each web-service call. Before SP1 there were no errors!!!
The exception is:
System.Web.HttpException (0x80004005): Server cannot append header after HTTP headers have been sent.
at System.Web.HttpResponse.AppendHeader(String name, String value)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
To reproduce the exception:
Create new web application, add a page with the following code:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication4.WebForm1" %>
<head runat="server">
<title></title>
<script runat="server">
Sub rg_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rg.NeedDataSource
Dim dt As New System.Data.DataTable()
dt.Columns.Add("Col1", GetType(String))
dt.Columns.Add("Col2", GetType(String))
For i As Integer = 0 To 10
dt.Rows.Add({"Row" & i, "Data"})
Next
rg.DataSource = dt
End Sub
</script>
<script type="text/javascript">
function callWebService()
{
$telerik.$.ajax({
type: 'POST',
url: 'WebService1.asmx/HelloWorld',
contentType: 'application/json; charset=utf-8',
dataType: 'json'
});
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager" runat="server">
</asp:ScriptManager>
<div>
<telerik:RadGrid ID="rg" runat="server" AutoGenerateColumns="true" Width="100%">
<ClientSettings>
<Scrolling AllowScroll="true" ScrollHeight="281px" UseStaticHeaders="true" />
</ClientSettings>
</telerik:RadGrid>
<asp:Button ID="aaa" runat="server" Text="callWebService" OnClientClick="callWebService(); return false;" />
</div>
</form>
</body>
</html>
Add a web-service with the following code-behind:
web.config System.webServer section:
Deploy the web application to an IIS web application!
Important!!! it must run in a "real" IIS web application and not the Visual Studio built in web server.
When pressing the button, an error on the server will always occur (even as the web service works!!!).
You can see the exception when attaching to the IIS and setting a break-point in Global.asax.vb on the Application_Error line (or logging the error here).
Regards
Caesar