HP3000-L Archives

October 2000, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Wonsil <[log in to unmask]>
Reply To:
Date:
Wed, 18 Oct 2000 09:09:54 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (78 lines)
It's a good idea but it may be a tougher method than is necessary.  You
already have a tool that will handle your HTTP requests in Apache.  May I
suggest that instead of reinventing the web server, use a socket from Apache
to get your work done.  The method I prefer is by using MOD_JSERV or Apache
Tomcat and a simple servlet.  The servlet makes and holds a connection to
your program (and you can pool them if you like).  The servlet receives your
requests and sends it down the socket to your program.  Your program does
its job and sends a reply back to the servlet and you let the servlet setup
your headers (which is trivial) calculate your Content-Length etc..  BTW,
this is basically how JSERV works.  See
http://java.apache.org/jserv/protocol/AJPv11.html for more info.  The
servlet is also a good place to make your data 'safe' by replacing '<', '>',
and '&' with their equivalent entities.  An added bonus is that the servlet
can keep session state for you.  This allows the Cobol program to just deal
with the business of the day.  The one servlet can then work for many
different requests as it has no particular business logic in it.  It can
even choose among multiple Cobol programs.  A further bonus is that your
Cobol program and your web server need not be on the same machine.  In this
way you can have multiple web servers communicate with your e3K and take the
load off of your production machine.  You can also add some simple security
with this method in that the web server can be outside your firewall and you
can open up the one port for communication.

HTH

Mark Wonsil
4M Enterprises, Inc.

>
> Good idea/Bad idea.
>
> This may be the triumph of hope over reality but can anyone
> identify any
> documents anywhere that explains, simply, the formatting
> requirements for
> headers when preparing to post to HTTP via port 80. I have
> found many on
> HTML formatting which discusses that the web application
> creates the header
> data but nothing on how one would do it programatically.
>
> I notice from an earlier posting on this subject in May, C and Java
> libraries were referenced, but I would like to try do this
> 'manually', via
> a COBOL program of all things.
>
> I have established I can post data out on port 80 but cannot
> get to grips
> with the formatting requirements of the HTTP header.
>
> The XML layouts (for thats what I intend to send) are pretty straight
> forward and I understand the tag delimitation.
>
> Its establishing the initial contact and delimiting the header data.
>
> The idea is that I will open socket 80 and simply post the
> string of data
> off to the application within the web area.
>
> I am currently trying to test this, with a simple script, on my HP by
> posting to a URL within my Apache environment, although
> eventually it will
> be out on the network, and get the following error in my
> apache error_log;
>
> [Tue Oct 17 17:19:30 2000] [error] Invalid URI in request POST public-
> html/titlemnt.bin HTTP/1.0  Content-Length: 31
> titlecode=1&salut=MR&ACTION=ADD
>
> The value ' POST public-html/titlemnt.bin HTTP/1.0  Content-Length: 31
> titlecode=1&salut=MR&ACTION=ADD ' is that simply sent via an
> IPCSend out on
> port 80 from a cobol prog.
>
> I may be asking a lot but, who knows, there could be
> something out there.
>

ATOM RSS1 RSS2