Home Server

WebTier and TIdHTTPWebBrokerBridge

edited October 2004 in Server
Hi, I'm getting AV when on the second time I access the url of the report
explorer. I'm using the server from the demo 03. Explorer Databases and
using a TIdHTTPWebBrokerBridge. Below is the code of the unit. The
properties from TrsWebTier are configured correctly.Remember that o first
access, everithing displays correctly, the folders, the treeview... when I
click Refresh on my browser, I get the AV. I'm using Borland Delphi 7 with
Update Pack 1 and ReportBuilder Server 7.03 Trial on Win2k3 Standard.

LogSettings.EnableLogging := False;
IniSettings.Enabled := False;
WebCachePath := 'http://localhost:31080/cache/';
WebModuleURI := 'http://localhost:31080/';

-----------------------------------------
unit MyWebTier;

interface

uses
SysUtils, Classes, ppComm, rsWebTier, HTTPApp;

type
TWebTierModule = class(TWebModule)
WebTier: TrsWebTier;
procedure WebModuleCreate(Sender: TObject);
procedure WebTierModuleReportActionAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
procedure WebTierModuleCacheActionAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
private
{ Private declarations }
public
{ Public declarations }
class procedure StartServices;
class procedure StopServices;
end;

implementation

{$R *.dfm}

uses
IdHTTPWebBrokerBridge;

var
ReportServer: TIdHTTPWebBrokerBridge;

{ TWebTierModule }

class procedure TWebTierModule.StartServices;
begin
ReportServer.Active := True;
end;

class procedure TWebTierModule.StopServices;
begin
ReportServer.Active := False;
end;

procedure TWebTierModule.WebModuleCreate(Sender: TObject);
begin
with WebTier do begin
CacheDirectory := ExtractFilePath(ParamStr(0)) + 'cache\';
ForceDirectories(CacheDirectory);
end;
end;

procedure TWebTierModule.WebTierModuleReportActionAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
Response.Content := WebTier.ProcessWebRequest(Request.QueryFields,
Request.Content);
end;

procedure TWebTierModule.WebTierModuleCacheActionAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var
FileStream: TFileStream;
begin
//TODO: Put here some security to restrict the files that can be opened.
Response.ContentStream := TFileStream.Create(ExtractFilePath(ParamStr(0))
+ Request.PathInfo, fmOpenRead or fmShareDenyNone);
end;

initialization
ReportServer := TIdHTTPWebBrokerBridge.Create(Nil);
with ReportServer do begin
Name := 'ReportServer';
DefaultPort := 31080;
Greeting.NumericCode := 0;
MaxConnectionReply.NumericCode := 0;
ReplyExceptionCode := 0;
ReplyUnknownCommand.NumericCode := 0;
RegisterWebModuleClass(TWebTierModule);
end;

finalization
ReportServer.Free;

end.

Comments

  • edited October 2004
    Using the same webmodule, the application works fine. I use the
    TidHTTPWebBrokerBridge to include a webserver on my application, to bypass
    the need of a third-party webserver. I use SOAP with TidHTTPWebBrokerBridge
    and the WebServices works fine, and many others approaches that use
    WebBroker works too. Only RBServer doesn't. U can try and see what is
    causing the AV, since u have the sources. If I cann't include the webserver
    and webtier, then RBServer 'll be useless for me, and I'll need to make my
    own way to publih my reports on a web browser. Can u see what is wrong?

    a
    TIdHTTPWebBrokerBridge.
    to
    the
    building
    report
    first
    I
    with
    Boolean);
    Boolean);
    TObject;
    opened.
  • edited October 2004


    We are not familiar with TIdHTTPWebBrokerBridge. Why are you not building a
    standard WebBroker application?

    1. First try to get a WebTier application working with the standard
    WebBroker

    2. Then try the same WebTier configuration with you TIdHTTPWebBrokerBridge.
    If you receive the AV, then I conclude the isse is related to the Indy
    component.

    ReportBuilder Server does not use any of the Indy components. During the
    developement of RB Server we evaluated the Indy component and found them to
    lacking in robustness and reliability. Personally I found that in using the
    Indy components, my machine would crash so hard, I literally had to unplug
    it. As for performance, that was lacking as well. At the time of
    developement their socket server did not use I/O completion port/worker
    thread technology (I/O completion port is a Windows technology for building
    for the highest performance threaded apps). ReportBuilder Server uses this
    technology extensively.

    For the highest performance I recommend using ISAPIApp and
    rsISAPIThreadPool.



    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited October 2004

    Please modify one the simple examples installed to RBServer\Demos\WebTier so
    that it uses the TidHTTPWebBrokerBridge and demonstrates the issue. Send in
    zip format to support@digital-metaphors.com and we can check it out here.



    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.