[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Initiate web server servlet
Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>
Hi,
The client configured TCP setting and got TELNET working, they are going 
to try the EXAMPLE 1 program tomorrow. Thanks alot for that support (re: 
Host not found thread)!
Glad it worked out.  I should really create a FAQ & Troubleshooting 
document for this sort of thing.  (That's one of those things that I never 
seem to get around to... sigh... whose idea was it to put only 24 hours in 
a day?!)
Now to the real project - the client's iSeries needs to post the 
following to an internal web server: 
http://localhost:9080/ClaimsToDW/ClaimsToDWServlet?msg=<data>filedata</data>
where localhost = the IP address for the internal server.  This post 
will initiate a servlet which will send the file data to a message 
queue:
I'm guessing, based on Example 5, that this can be done with this RPG 
function:
http_url_post_raw('http://localhost:9080/ClaimsToDW/ClaimsToDWServlet?': 
%addr(XXXX): %len(%trimr(XXXX)):1: %paddr('INCOMING'))
where XXXX is a variable that contains the text '<data>filedata</data>. 
This will return a success/failure return code.
Is this correct or am I way off? :-)
Yes, I think you're on the right track.  Just a few minor nits:
a) When you add a '?' and parameters to the end of a URL, that's a
     GET request, not a POST request.  If that's REALLY what you want
     to do (and I'm skeptical) then you want to use http_url_get_raw
     instead of post_raw.
b) If you do it as a GET request, the data needs to be encoded and added
     to the URL (see the thread called "Parameters" on this list for
     more info.)
c) If you do it as a POST request, you do not want the '?' at the end of
     the URL.
d) the 'INCOMING' subprocedure is a piece of code that you need to write
      (or copy from my examples). That HTTPAPI will call when data arrives
      on the wire.
BTW I'm very impressed with the support you and others have given with 
this utility - I appreciate it!
You're welcome. Please try to return the favor and help other people who 
ask questions on this mailing list when they have problems. I'm one man. 
As more and more people use this software, it gets harder and harder for 
me to keep up with helping people. Your continued participation in this 
list will help alleviate that problem.
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------