× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.






Hi Kevin - Let me help Bent here .. my answers in your mail ...


Bent

What if I want it to be more generic than that? In other words, I don't know (or care) what the variables are on the query string - I just want to get the entire query string. Is there a BIF for that? I don't want it translated to EBCDIC either - I just want it in its raw form (i.e. UTF-8).

simply:

myQryStr = getServerVar('REQUEST_RAW'); // this will be in the CCSID of your job
myQryStr = getServerVar('REQUEST_RAW_BIN'); // this will be url-encoded ascii stuff




I would also need the equivalent of "ResponseWrite" which will accept a pointer to data that will include the HTTP header and that will not translate from EBCDIC (the data will already be in UTF-8). Is there a BIF for that?
If it cannot accept a pointer then one that can be called in a loop will do, so the response can be sent in chunks.

1)
if you want to send in chunks. IceBreak supports automatically "Chunked Transfer encoding" (rfc 2616)
http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html

just call :

setChunked(1024) ; // where 1024 is the chunk threshold

2)
The header is controlled much like on tomcat or IIS

setHeader("cachetimeout" : "1234");


3)
the loop:

you can just iterate arroud a response write:

for i = 1 to 100;
responseWrite("Hello " + %char(i) );
endFor;


4)
and pointers - we have an feature ILOB - Internal Large Objects ( like CLOB / BLOB in db/2) which is pointer (to i.e. a userspace)

setResponseObject(myPacePointer);

then:

responseWrite("Mystuff");
responseWrite("more stuff");
responseWrite("Mystuff");
responseWrite("Mystuff");

... goes to the ILOB ( the userspace)

and finally :

setResponseObject(*NULL); // Now output goes to the browser again
responseWriteIlob(myPacePointer); // and we send the ilob ( the userspace to the client)





If so, then it would be very easy for me to run a Renaissance application (or a CGIDEV2 application) behind an IceBreak server rather than an Apache server - I can therefore compare and contrast the performance differences under load. I am very interested in having an alternative to Apache that also scale up to a minimum of 1000 concurrent sessions.

remember that IceBreak handles the "task switching" for you so you don't have to relocate resource if a new session kicks in ( you dont need all the SETLL with the new session) .. you will ( or can ) have a session mapped to a OS/400 job which again is purged so you can relly on OS/400 to do the workload balance which it does brilliantly with these tiny IceBreak jobs.



Also, is it possible to configure the equivalent of environment variables for the server in a similar way to being able to do so with Apache? For example (in Apache):
SetEnv <name> <value>
So I can retrieve these bespoke config values as well as other usual suspects (like SERVER_SOFTWARE, REQUEST_METHOD, HTTP_USER_AGENT etc etc).


1)
we have the equivalent to PHP:

ie:
if getServerVar('REQUEST_METHOD') = "POST";
doPostStuff();
endif;

2)
set env:

we have system wide settings:

getGlobal() and setGlobal()

and for the session:

getSessionVar() and setSessionVar()

which remains even if you jobs times out and/or have to be reloaded


I already have the all the goodies I need in Renaissance (like SQL_Execute) so it is really the start and end-point that I would like to concentrate my enthusiasm on :-)

Actually we are trying to combine the webserver, the applicationserver, the toolbox/utilities like SQL_Execute , httpRequest , xmlParseFile (for x-path) etc. to give you a solid foundation, and not only a framework.

But if it works in Renaissance with appache, why change it... if you look at i.e. PowerExt, it runs both apache/CGI and IceBreak at the same time. apache/CGI for basic extJs stuff and IceBreak for running old 5250 (IceCap'ed) apps in extJs.

You can do both :)



I have posted a similar question on your forum if you think it is better to take this offline?


Thanx Kevin - I think you might like if i gave you the-grand-tour-demo-go-2-meeting some time :)

Rgds
Kevin


-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Bent Rønne
Sent: 30 December 2010 20:38
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] IceBreak as an alternative to Apache?

Hi Keven

It is true that is IceBreak probably at least 10 times as fast as Appache and the reason is very simple. IceBreak uses the direct way to read the request from the browser and write the response back again. Opposite if you use appache, your programs use the stdin & stdout to communicate with the browser. Stdin & stdout are files that must be handled and here you have the problem with performance and Appache. Therefore it will not help if IceBreak could do the same as Appache. However, it would probably not require a big job to rewrite the programs to IceBreak.

In IceBreak there is a number of Build in Functions (BIF) which makes the approach to request & response very simple. E.g. you can move data from the URLs parameters with the function Qrystr (Alfanumeric) or Qrystrnum (Numeric)

Sample:

From your browsers url:
http://myserver:8080/myrpgpgm.rpgle?custno=1234

RPG:
/free
...
Custno = qrystrnum('custno');
Chain custno customer;
...

When it comes to the form fields from the browser, there is BIF's to read them as well.

The HTML file:

<html>
<form action=" myrpgpgm.rpgle " method="post" name="form1">
Enter Customer name, and press enter:
<input type="text" name=" CustName">
</form>
</html>

The RPG program
...
CustName = form('CustName':CustName);
Update customer;
...


And when you need to send information back to the browser you can simply use BIF's like "ResponseWrite"

ResponseWrite('<html>The customer name is: ' + custName + '..');

I hope this can help you further in your search for the perfect solution. By the way you should invest some time investigating the BIF's in IceBreak.

Check out for example the BIF like SQL_Execute! With this function you can build a request object directly to the browser using SQL. The function takes three parameters; 1. The result set data format, 2. A SQL command, and 3. The maximum number of records to return. If you look at my sample from earlier today, you will see that I'm using a format called "I_EXTJSMETA". This means that the result set will be returned directly in extJS format including metadata - yes you heard right - with just one line of code you can build an entire list of data from a database file directly in extJS.

Regards

Bent


-----Oprindelig meddelelse-----
Fra: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] På vegne af Kevin Turner
Sendt: 30. december 2010 17:50
Til: Web Enabling the AS400 / iSeries
Emne: [WEB400] IceBreak as an alternative to Apache?

Bent

I have changed the thread title for this. I was also slightly misled by the examples into thinking it was an ASP approach and nothing else, so maybe the examples could do with an update? I say that in the full knowledge that it is easier said than done and we don't manage to do it very well either!

That aside, is it possible to use the IceBreak HTTP server as a replacement for Apache for applications that have already been written? To be more specific, if I have an RPG program that reads from stdin using QtmhRdStin and returns output via QtmhWrStout can I call that program via the IceBreak HTTP server and have content returned to the browser? Even if it is not possible now, would it be possible after a little bit of pain on my part?

Is it really 10 times faster than Apache as was claimed earlier by Jim?

Rgds
Kevin



-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Bent Rønne
Sent: 30 December 2010 15:00
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] 5250 programmer to web programmer

Hi Maurice

With IceBreak, you can choose which path you will go with your web development. You are not bound by any methods or mask programs, but can freely choose from all shelves. All the freedom which IceBreak makes available means of course that you must find the method that suits you best.

Some choose the ASP route, while others choose to split HTML, JavaScript (JS) and RPGLE in different files. Eg. I have recently programmed an "edit system value" maintain application - in ExtJs by the Way. I have divided the pieces into html, JS and RPGLE source in three different files.

You can find all sources here http://www.icebreak.dk/sysvaledit.zip

First there is my HTML (sysValEdit.html) who is just used to link things together with references to my JS and of course the primary link to the application (http://myserver:8080/sysValEdit.html) from the URL in the browser.

Eg.:

<html>
...
<script type="text/javascript" src="sysValEdit.js"> </ script> ...
</ Html>

sysValEdit.js is a larger file that is written in 100% JS and it is the one that contains the ExtJS code. It uses AJAX to retrieve my data from my System i. When the browser is ready for showing, it calls my RPGLE program SYSVALEDIT directly on my System i and returns data to the browser. The RPGLE program is written in pure RPGLE except for the first line of code in this example. This line is used by the IceBreak pre-compiler to switch to RPGLE. But if you like to have your RPGLE isolated in a source file in a library, you simple make your own 100 % RPGLE code and compile the source without the IceBreak pre-compiler - use whatever you like, WSDL, RDi, SEU to edit and compile - I don't care. All you need is a binding directory and guess what - it is called ICEBREAK.

This is just one way to use IceBreak on! You can choose the path that you yourself seem to suit you.

You should also know that there is an IceBreak community where you can find lot more information:

http://www.icebreak-community.com/

I hope that you can use my information in your quest for the perfect solution for Web and System i.

Regards

Bent Ronne
Technical Manager
System & Method A/S


NOTICE: The information in this electronic mail transmission is intended by CoralTree Systems Ltd for the use of the named individuals or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone, so that the sender's address records can be corrected.



--------------------------------------------------------------------------------


CoralTree Systems Limited
25 Barnes Wallis Road
Segensworth East, Fareham
PO15 5TT

Company Registration Number 5021022.
Registered Office:
12-14 Carlton Place
Southampton, UK
SO15 2EA
VAT Registration Number 834 1020 74.
--
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.

--
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.


NOTICE: The information in this electronic mail transmission is intended by CoralTree Systems Ltd for the use of the named individuals or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone, so that the sender's address records can be corrected.



--------------------------------------------------------------------------------


CoralTree Systems Limited
25 Barnes Wallis Road
Segensworth East, Fareham
PO15 5TT

Company Registration Number 5021022.
Registered Office:
12-14 Carlton Place
Southampton, UK
SO15 2EA
VAT Registration Number 834 1020 74.
--
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.





As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.