fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: IIS7 and up Handler

IIS7 and up Handler 1 year 5 months ago #1

Hallo

You all know i am still trying to write a web applikation with XSharp.

First: i tried it with CGI like before with VO. MS IIS7 and up is using something like a sandbox and so some importend DLL for the DBF's and so on is not found. There is a workaorund. You have to start a *.cmd file first and this will call the the CGI , then it works.

Now, before i have to make a decision what i will do. i am trying a second way.

Second: Using a ISS7 Handler. After houres i found a example and i was be able to let it run. Now i have to translate it to XSharp and then i wanna write out a DBF file with index, testing if this solution is be able to use the DBF driver.

using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.IO;

namespace MyIIS7Project
{
public class MyHandler : IHttpHandler
{
#region IHttpHandler Members
public bool IsReusable
{
get { return true; }
}
public void ProcessRequest(HttpContext context)
{
context.Response.Write(
String.Format("<h1>{0}</h1>",
Directory.GetCurrentDirectory()
));
}
#endregion
}
}
BTW the current durectory is windows\system32\intserv

My Version is:
BEGIN NAMESPACE MyIIS7Project
public class MyHandler inherit IHttpHandler
#region IHttpHandler Members
Method IsReusable () as logic
return true

Method ProcessRequest(context as HttpContext) as void
context:Response:Write("Hallo Welt")
return

end class
#endregion
END NAMESPACE

But i got this error
Fehler XS0535 'MyHandler' does not implement interface member 'IHttpHandler.IsReusable' MyIIS7Project C:\Users\Besitzer\source\repos\MyIIS7Project\MyIIS7Project\MyHandler.prg 8
its on the line public class ....

Help :-)

Horst

Please Log in or Create an account to join the conversation.

IIS7 and up Handler 1 year 5 months ago #2

Hi Horst,

"IsReusable" is a property, not a method, so you'd need to define int like that:

ACCESS IsReusable AS LOGIC
RETURN TRUE

or, in the more /Net style (completely equivalent) syntax:

PROPERTY IsReusable AS LOGIC
GET
RETURN TRUE
END GET
END PROPERTY

or, like the simplified onliner:

PROPERTY IsReusable AS LOGIC GET TRUE

all the above should do the trick.

Chris
XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

IIS7 and up Handler 1 year 5 months ago #3

  • wriedmann
  • wriedmann's Avatar
  • Away
  • Posts: 1436
  • Karma: 6
Hi Horst,
public class MyHandler : IHttpHandler

could be translated to
public class MyHandler inherit IHttpHandler

and to
public class MyHandler implements IHttpHandler

But since IHttpHandler is an interface,
implements
is the correct one.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

  • Page:
  • 1