A
Alphapage
Hello,
I want to process the following code in WCF:
using System;
using System.Web;
using System.Web.UI;
using System.Web.Services.Protocols;
using System.Web.SessionState;
public class AspCompatWebServiceHandler :
System.Web.UI.Page, IHttpAsyncHandler, IRequiresSessionState
{
protected override void OnInit(EventArgs e)
{
IHttpHandler handler =
new WebServiceHandlerFactory ().GetHandler(
this.Context,
this.Context.Request.HttpMethod,
this.Context.Request.FilePath,
this.Context.Request.PhysicalPath);
handler.ProcessRequest(this.Context);
this.Context.ApplicationInstance.CompleteRequest();
}
public IAsyncResult BeginProcessRequest(
HttpContext context, AsyncCallback cb, object extraData)
{
return this.AspCompatBeginProcessRequest(
context, cb, extraData);
}
public void EndProcessRequest(IAsyncResult result)
{
this.AspCompatEndProcessRequest(result);
}
}
In order for AspCompatWebServiceHandler to work its magic, it must be
registered as the HTTP handler for ASMX files. You can register it using this
web.config file:
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="*.asmx"
type="AspCompatWebServiceHandler, __code" />
</httpHandlers>
</system.web>
</configuration>
Thanks for your help.
I want to process the following code in WCF:
using System;
using System.Web;
using System.Web.UI;
using System.Web.Services.Protocols;
using System.Web.SessionState;
public class AspCompatWebServiceHandler :
System.Web.UI.Page, IHttpAsyncHandler, IRequiresSessionState
{
protected override void OnInit(EventArgs e)
{
IHttpHandler handler =
new WebServiceHandlerFactory ().GetHandler(
this.Context,
this.Context.Request.HttpMethod,
this.Context.Request.FilePath,
this.Context.Request.PhysicalPath);
handler.ProcessRequest(this.Context);
this.Context.ApplicationInstance.CompleteRequest();
}
public IAsyncResult BeginProcessRequest(
HttpContext context, AsyncCallback cb, object extraData)
{
return this.AspCompatBeginProcessRequest(
context, cb, extraData);
}
public void EndProcessRequest(IAsyncResult result)
{
this.AspCompatEndProcessRequest(result);
}
}
In order for AspCompatWebServiceHandler to work its magic, it must be
registered as the HTTP handler for ASMX files. You can register it using this
web.config file:
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="*.asmx"
type="AspCompatWebServiceHandler, __code" />
</httpHandlers>
</system.web>
</configuration>
Thanks for your help.