[BR_forum] BR 4.2 HTTP - CLIENT

More advanced topics discussed.

Moderators: Susan Smith, admin, Gabriel

Post Reply
gordon
Posts: 358
Joined: Fri Apr 24, 2009 6:02 pm

[BR_forum] BR 4.2 HTTP - CLIENT

Post by gordon »

Get HTTP.ZIP form Dll_Distr. This was distributed at the 2007 fall conference and I just copied it to Dll_Distr.

gordon



On Wed, Apr 29, 2009 at 7:58 AM, Luis I. Gomez <GomezL@collectionsoftware.com (GomezL@collectionsoftware.com)> wrote:

I was looking at the  Br 4.2 release notes, and it looks like HTTP Client & Server is documented.  
 
Does anyone have a short program that actually reads a web site?
I remember that there was something that checked the UPS tracking #’s or something like that.
 
I figure it’s timehink like
 
OPEN #1:”NAME=http://ads.net,HTTP=CLIENT”,D,I
 
When I try LINPUT I get error 716.
 
Clearly I am missing something.
 

  HTTP Support
The OPEN string for XML and DISPLAY files will support a new optional parameter called HTTP=CLIENT or HTTP=SERVER. The CLIENT or SERVER designation will denote processing in the following sequence:
CONFIG   HTTP PORT 5555    LOG file-pathnameCONFIG   HTTPS PORT 7777   LOG file-pathname


 
 
 
CLIENT
OPEN
   NAME=Full URL -     web page reference -
   CONTROL=display-filename

PRINT (accumulate post data) PRINT …
·         When the first LINPUT is issued POSTing of all print lines occurs
·         and all responses are buffered before the LINPUT returns data.
LINPUT
·         until EOF is reached or until another PRINT is issued
·         a PRINT clears the LINPUT buffer
Processing must be performed in the above sequence or an error is generated.
FILE$(fileno,”HTTPINFO”) returns LOG info for the latest action.
 
 
Luis I. Gomez
GomezL@CollectionSoftware.com (GomezL@CollectionSoftware.com)
1-800-435-7257
Commercial Legal Software, Inc.
http://www.CollectionSoftware.com
 


_______________________________________________
BR_forum mailing list
BR_forum@ads.net (BR_forum@ads.net)
http://ads.net/mailman/listinfo/br_forum_ads.net
Stephen Koger

[BR_forum] BR 4.2 HTTP - CLIENT

Post by Stephen Koger »

I was thinking that demo didn’t include an example webserver. Here is some Server code I found. I was thinking Dan may have sent it to me.


From: br_forum-bounces@ads.net [mailto:br_forum-bounces@ads.net] On Behalf Of Gordon Dye
Sent: Wednesday, April 29, 2009 9:15 AM
To: Business Rules Forum
Subject: Re: [BR_forum] BR 4.2 HTTP - CLIENT


Get HTTP.ZIP form Dll_Distr. This was distributed at the 2007 fall conference and I just copied it to Dll_Distr.

gordon



On Wed, Apr 29, 2009 at 7:58 AM, Luis I. Gomez <GomezL@collectionsoftware.com (GomezL@collectionsoftware.com)> wrote:
I was looking at the Br 4.2 release notes, and it looks like HTTP Client & Server is documented.

Does anyone have a short program that actually reads a web site?
I remember that there was something that checked the UPS tracking #’s or something like that.

I figure it’s timehink like

OPEN #1:”NAME=http://ads.net,HTTP=CLIENT”,D,I

When I try LINPUT I get error 716.

Clearly I am missing something.


HTTP Support
The OPEN string for XML and DISPLAY files will support a new optional parameter called HTTP=CLIENT or HTTP=SERVER. The CLIENT or SERVER designation will denote processing in the following sequence:
CONFIG   HTTP PORT 5555    LOG file-pathnameCONFIG HTTPS PORT 7777 LOG file-pathname



CLIENT
OPEN
NAME=Full URL - web page reference -
CONTROL=display-filename

PRINT (accumulate post data) PRINT …
· When the first LINPUT is issued POSTing of all print lines occurs
· and all responses are buffered before the LINPUT returns data.
LINPUT
· until EOF is reached or until another PRINT is issued
· a PRINT clears the LINPUT buffer
Processing must be performed in the above sequence or an error is generated.
FILE$(fileno,”HTTPINFO”) returns LOG info for the latest action.


Luis I. Gomez
GomezL@CollectionSoftware.com (GomezL@CollectionSoftware.com)
1-800-435-7257
Commercial Legal Software, Inc.
http://www.CollectionSoftware.com




_______________________________________________
BR_forum mailing list
BR_forum@ads.net (BR_forum@ads.net)
http://ads.net/mailman/listinfo/br_forum_ads.net
Attachments
httpserver.br
(1.63 KiB) Downloaded 903 times
GomezL
Posts: 258
Joined: Wed Apr 29, 2009 5:51 am
Contact:

[BR_forum] BR 4.2 HTTP - CLIENT

Post by GomezL »

I was able to install the server code, but I can’t figure out how to access it.

I figured a good guess would be : http://localhost

Any ideas what url I need to use to connect to the server?

The program connects through this open statement:

00030 OPEN #1: "name=DBServer,http=server,recl=1000,eol=none",DISPLAY,OUTIN

Luis I. Gomez
GomezL@CollectionSoftware.com (GomezL@CollectionSoftware.com)
1-800-435-7257
Commercial Legal Software, Inc.
http://www.CollectionSoftware.com


From: br_forum-bounces@ads.net [mailto:br_forum-bounces@ads.net] On Behalf Of Stephen Koger
Sent: Wednesday, April 29, 2009 10:32 AM
To: 'Business Rules Forum'
Subject: Re: [BR_forum] BR 4.2 HTTP - CLIENT



I was thinking that demo didn’t include an example webserver. Here is some Server code I found. I was thinking Dan may have sent it to me.


From: br_forum-bounces@ads.net [mailto:br_forum-bounces@ads.net] On Behalf Of Gordon Dye
Sent: Wednesday, April 29, 2009 9:15 AM
To: Business Rules Forum
Subject: Re: [BR_forum] BR 4.2 HTTP - CLIENT


Get HTTP.ZIP form Dll_Distr. This was distributed at the 2007 fall conference and I just copied it to Dll_Distr.

gordon


On Wed, Apr 29, 2009 at 7:58 AM, Luis I. Gomez <GomezL@collectionsoftware.com (GomezL@collectionsoftware.com)> wrote:
I was looking at the Br 4.2 release notes, and it looks like HTTP Client & Server is documented.

Does anyone have a short program that actually reads a web site?
I remember that there was something that checked the UPS tracking #’s or something like that.

I figure it’s timehink like

OPEN #1:”NAME=http://ads.net,HTTP=CLIENT”,D,I

When I try LINPUT I get error 716.

Clearly I am missing something.


HTTP Support
The OPEN string for XML and DISPLAY files will support a new optional parameter called HTTP=CLIENT or HTTP=SERVER. The CLIENT or SERVER designation will denote processing in the following sequence:
CONFIG   HTTP PORT 5555    LOG file-pathnameCONFIG HTTPS PORT 7777 LOG file-pathname



CLIENT
OPEN
NAME=Full URL - web page reference -
CONTROL=display-filename

PRINT (accumulate post data) PRINT …
· When the first LINPUT is issued POSTing of all print lines occurs
· and all responses are buffered before the LINPUT returns data.
LINPUT
· until EOF is reached or until another PRINT is issued
· a PRINT clears the LINPUT buffer
Processing must be performed in the above sequence or an error is generated.
FILE$(fileno,”HTTPINFO”) returns LOG info for the latest action.


Luis I. Gomez
GomezL@CollectionSoftware.com (GomezL@CollectionSoftware.com)
1-800-435-7257
Commercial Legal Software, Inc.
http://www.CollectionSoftware.com




_______________________________________________
BR_forum mailing list
BR_forum@ads.net (BR_forum@ads.net)
http://ads.net/mailman/listinfo/br_forum_ads.net
Stephen Koger

[BR_forum] BR 4.2 HTTP - CLIENT

Post by Stephen Koger »

Http://localhost would be correct. You must have some other application running on your machine that is using port 80, or a Firewall application running on your machine that is blocking access to port 80.

Steve


From: br_forum-bounces@ads.net [mailto:br_forum-bounces@ads.net] On Behalf Of Luis I. Gomez
Sent: Monday, May 04, 2009 6:11 AM
To: Business Rules Forum
Subject: Re: [BR_forum] BR 4.2 HTTP - CLIENT


I was able to install the server code, but I can’t figure out how to access it.

I figured a good guess would be : http://localhost

Any ideas what url I need to use to connect to the server?

The program connects through this open statement:

00030 OPEN #1: "name=DBServer,http=server,recl=1000,eol=none",DISPLAY,OUTIN

Luis I. Gomez
GomezL@CollectionSoftware.com (GomezL@CollectionSoftware.com)
1-800-435-7257
Commercial Legal Software, Inc.
http://www.CollectionSoftware.com


From: br_forum-bounces@ads.net [mailto:br_forum-bounces@ads.net] On Behalf Of Stephen Koger
Sent: Wednesday, April 29, 2009 10:32 AM
To: 'Business Rules Forum'
Subject: Re: [BR_forum] BR 4.2 HTTP - CLIENT



I was thinking that demo didn’t include an example webserver. Here is some Server code I found. I was thinking Dan may have sent it to me.


From: br_forum-bounces@ads.net [mailto:br_forum-bounces@ads.net] On Behalf Of Gordon Dye
Sent: Wednesday, April 29, 2009 9:15 AM
To: Business Rules Forum
Subject: Re: [BR_forum] BR 4.2 HTTP - CLIENT


Get HTTP.ZIP form Dll_Distr. This was distributed at the 2007 fall conference and I just copied it to Dll_Distr.

gordon
On Wed, Apr 29, 2009 at 7:58 AM, Luis I. Gomez <GomezL@collectionsoftware.com (GomezL@collectionsoftware.com)> wrote:
I was looking at the Br 4.2 release notes, and it looks like HTTP Client & Server is documented.

Does anyone have a short program that actually reads a web site?
I remember that there was something that checked the UPS tracking #’s or something like that.

I figure it’s timehink like

OPEN #1:”NAME=http://ads.net,HTTP=CLIENT”,D,I

When I try LINPUT I get error 716.

Clearly I am missing something.


HTTP Support
The OPEN string for XML and DISPLAY files will support a new optional parameter called HTTP=CLIENT or HTTP=SERVER. The CLIENT or SERVER designation will denote processing in the following sequence:
CONFIG   HTTP PORT 5555    LOG file-pathnameCONFIG HTTPS PORT 7777 LOG file-pathname



CLIENT
OPEN
NAME=Full URL - web page reference -
CONTROL=display-filename

PRINT (accumulate post data) PRINT …
· When the first LINPUT is issued POSTing of all print lines occurs
· and all responses are buffered before the LINPUT returns data.
LINPUT
· until EOF is reached or until another PRINT is issued
· a PRINT clears the LINPUT buffer
Processing must be performed in the above sequence or an error is generated.
FILE$(fileno,”HTTPINFO”) returns LOG info for the latest action.


Luis I. Gomez
GomezL@CollectionSoftware.com (GomezL@CollectionSoftware.com)
1-800-435-7257
Commercial Legal Software, Inc.
http://www.CollectionSoftware.com




_______________________________________________
BR_forum mailing list
BR_forum@ads.net (BR_forum@ads.net)
http://ads.net/mailman/listinfo/br_forum_ads.net
mluchterhand
Posts: 52
Joined: Mon Jun 08, 2009 7:28 pm
Location: Des Moines, IA
Contact:

Re: [BR_forum] BR 4.2 HTTP - CLIENT

Post by mluchterhand »

Does anyone have a sample of connecting to a secure site with BR? The programs in http.zip on the FTP site seem to be dated and sites like UPS now require secure connections. The wiki mentions that ca-bundle.crt is required to connect to HTTPS however it has no instructions of where this should be placed or if any additional configuration is necessary.

I am not looking to do anything fancy at the moment. Currently something like this works fine:

Code: Select all

DIM XML$*10000,INFO$*10000
OPEN #2: "name=http://www.ups.com,http=client",DISPLAY,OUTIN
OPEN #3: "name=testout.txt,replace,recl=10000",DISPLAY,OUTPUT
! ***** write request
DO
  LINPUT #2: XML$ EOF DNE
  PRINT #3: XML$
LOOP
DNE: ! ***** get response
!
However, when changing the http open to

Code: Select all

OPEN #2: "name=https://www.ups.com,http=client",DISPLAY,OUTIN
you get error 4340 on line 600. SYSERR is 77 and SYSERR$ is "problem with the SSL CA cert (path? access rights?)".

Any feedback would be greatly appreciated. This is not urgent by any means. Thanks in advance.
Thanks - Matt Luchterhand
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

Re: [BR_forum] BR 4.2 HTTP - CLIENT

Post by Gabriel »

The file is called ca-bundle.crt and I've attached it to this post, though the forum made me add a .txt extension before it would let me post it.

Download the attached file (ca-bundle.crt.txt), rename it to ca-bundle.crt, and place it in the same folder that your br executable is located.

After that you should be able to access https web sites.

Gabriel
Attachments
ca-bundle.crt.txt
(250.33 KiB) Downloaded 769 times
gordon
Posts: 358
Joined: Fri Apr 24, 2009 6:02 pm

Re: [BR_forum] BR 4.2 HTTP - CLIENT

Post by gordon »

I would like to clarify several things relating to BR HTTP support.

1) HTTP Client is supported as described in the attached 4.2 release notes. Additionally 4.3 permits an initial LINPUT without a preceding PRINT.

2) HTTP Server is no longer supported as a general purpose web technology except in conjunction with Web_Server.bro, which is free.

3) Previously, HTTP Server required a special license file. BR now accepts concurrent web client accesses up to the number of licensed BR users without a special license. Web client accesses do not occupy a BR WSID. However, the Web_Server program occupies one BR user license. HTTP Client has never required a special license.

4) The BR Web Server documentation refers to the 4.3 release notes for instructions on how to configure HTTPS. These notes have recently been revised to describe the ca-bundle.crt file. This file must be present with the BR executable in order for BR to work with HTTPS as either the client or the server. In addition two PEM files are needed for the server configuration (see 4.3 release notes).

The ca-bundle.crt file is now available at ftp://ftp.brulescorp.com/Dll_Distr/CURR ... h/winutil/
(The forum would not accept that file type, so I can't load it here.)

The release notes now specify:
Encryption is invoked by Business Rules HTTP support as follows:

CONFIG HTTPS port-number [ LOG= file-pathname ] [BUFFSIZE= buffer size]
CONFIG OPTION 66 private-key-file-encryption-password (called passphrase )
OPEN #400: “HTTP=SERVER”, DISPLAY, OUTIN

The BRSERVER executable directory must contain three files:
https-private.pem
https-cert.pem
ca-bundle.crt

The ca-bundle.crt file is provided by BRC in the utilities section of BR releases. The pem files are made by the following commands under Linux, MAC and cygwin for Windows:
openssl req -new -x509 -out httpserver.pem -days 10000
( this will prompt for the OPTION 66 password – as passphrase)
mv privkey.pem https-private.pem
mv httpserver.pem https-cert.pem

This port specific service can then be accessed with browsers. When the specified port is accessed through a browser, BR establishes an HTTPS connection rather than an HTTP connection.
5) It is the user's responsibility to setup their web server application so it is transaction oriented, servicing one client request at a time and distinguishing between each client. The Web Server assists with this process as described in the Web Server documentation.
Attachments
Release Notes 4.2.doc
(126.5 KiB) Downloaded 775 times
mluchterhand
Posts: 52
Joined: Mon Jun 08, 2009 7:28 pm
Location: Des Moines, IA
Contact:

Re: [BR_forum] BR 4.2 HTTP - CLIENT

Post by mluchterhand »

Thank you Gabriel and Gordon for the information. I was able to successfully connect to a couple different secure sites after placing the ca-bundle.crt with my BR executable. I appreciate the information!
Thanks - Matt Luchterhand
mluchterhand
Posts: 52
Joined: Mon Jun 08, 2009 7:28 pm
Location: Des Moines, IA
Contact:

Re: [BR_forum] BR 4.2 HTTP - CLIENT

Post by mluchterhand »

I may have spoken too soon about being able to successfully connect. Everything works fine in my test environment but when I move the program to our live environment (which is client-server) things seem to break. Is there some special configuration I need to do with client-server? I have the ca-bundle.crt placed with the executables on both the client and server but I get an error when trying to LINPUT the secure sites. I have tries various sites and on some sites I get syserr 1 - unsupported protocol. On other sites I get syserr 10035 - client system error.
Thanks - Matt Luchterhand
bluesfannoz
Posts: 291
Joined: Fri Jun 19, 2009 9:01 am
Location: Lawrence, Kansas
Contact:

Re: [BR_forum] BR 4.2 HTTP - CLIENT

Post by bluesfannoz »

Matt did you ever get this to work with client server?
Steve Koger
Computer Specialist
SEKESC-MACS Division
mluchterhand
Posts: 52
Joined: Mon Jun 08, 2009 7:28 pm
Location: Des Moines, IA
Contact:

Re: [BR_forum] BR 4.2 HTTP - CLIENT

Post by mluchterhand »

Steve,

I was able to get it working but I had to use an external tool to make it work. I ended up using cURL (which is free) to dump the contents of the webpage into a text file and then read that text file from BR. I was never able to directly read secure websites directly from BR. Thanks for the follow up.
Thanks - Matt Luchterhand
bluesfannoz
Posts: 291
Joined: Fri Jun 19, 2009 9:01 am
Location: Lawrence, Kansas
Contact:

Re: [BR_forum] BR 4.2 HTTP - CLIENT

Post by bluesfannoz »

What version of BR were you able to get it to connect with, non client/server?
Steve Koger
Computer Specialist
SEKESC-MACS Division
mluchterhand
Posts: 52
Joined: Mon Jun 08, 2009 7:28 pm
Location: Des Moines, IA
Contact:

Re: [BR_forum] BR 4.2 HTTP - CLIENT

Post by mluchterhand »

Version 4.31fb
Thanks - Matt Luchterhand
bluesfannoz
Posts: 291
Joined: Fri Jun 19, 2009 9:01 am
Location: Lawrence, Kansas
Contact:

Re: [BR_forum] BR 4.2 HTTP - CLIENT

Post by bluesfannoz »

Thanks Matt
Doing a session at the conference on connecting to a webserver and wanted to demonstrate it using an https connection if I could. So I will test later client server versions and see if Gordon resolved the issue.
Steve Koger
Computer Specialist
SEKESC-MACS Division
Post Reply