Dont feel bad about it. I should blame me for writing an half implementation.
With the classname in front of the funtion get_IsReuseable started to work also i added an constructor so the code now looks like this:
[pascal]
unit MyHandler;
interface
uses System.Web;
type
HelloWorldHandler = class(IHttpHandler)
public
constructor Create;
function get_IsReusable: Boolean;
property IsReusable: Boolean read get_IsReusable;
procedure ProcessRequest(context: HttpContext);
end;
implementation
constructor HelloWorldHandler.Create;
begin
inherited Create;
end;
function HelloWorldHandler.get_IsReusable: Boolean;
begin
Result := False;
end;
procedure HelloWorldHandler.ProcessRequest(context: HttpContext);
var
Response: HttpResponse;
Request: HttpRequest;
begin
Request := context.Request;
Response := context.Response;
Response.Write('<html>');
Response.Write('<body>');
Response.Write('<h1>Hello from a synchronous custom HTTP handler written in
Delphi Prism.</h1>');
Response.Write('</body>');
Response.Write('</html>');
end;
end.
[/pascal]
And compiles with this:
And in web.config the following should be added to the httphandlers:Code:Oxygene MyHandler.pas /assemblyname:MyHandler /type:library /frameworkfolder:C:\WINDOWS\Microsoft.NET\FrameWork\v2.0.50727 /ref:$(Framework)\System.Web.dll /ref:$(Framework)\System.dll
<add verb="*" path="*.sample" type="MyHandler.HelloWorldHandler,MyHandler"/>
So http://localhost/test/test.sample shows Hello from a synchronous custom HTTP handler written in Delphi Prism.
_________________________________________________
I use the free command line edition of Delphi Prism which can be downloaded for free at: http://cc.codegear.com/Free.aspx?id=26256
Bookmarks