[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Post vs Post_raw
Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>
1) Since the post programs are our first try connecting to the parent
company's web server and we got a timeout error when the web server was
hung, can we rule out connectivity problems?
If you're getting a '500' error from the server, then this isn't a
connectivity problem. If the server is able to send you an error, you're
obviously communicating with it.
1) Do you know why the http_url_post program hangs while the
http_url_post_raw program did not? It seems that the post (no raw) is
expecting a document that the web server isn't giving it?
Heh... Shouldn't this be question #2? (You started two questions with
"1)")
Actually, post() and post_raw() are the same routine under-the-covers.
The only difference is that post() calls IBM's write() API (via procedure
pointer), whereas post_raw() calls a routine of your devising via that
same procedure pointer.
Since the same piece of code is communicating with the server in both
cases, I don't see how there could be a difference on your end. The
difference is on the server-side.
2) For this project, we don't need to process the data received back
from the server, so would you suggest we use the http_url_post or the
http_url_post_raw function?
I'd suggest the _raw() routine in that case, since you can choose to
completely discard the data instead of saving it somewhere.
3) Why does the HTTP API utility check for the length of the data
returned from the web server?
To make sure that it received everything. Otherwise, if a network error
caused you to receive part of the data, but not all of it, the program
wouldn't be able to detect that something went wrong.
Is this HTTP 'under the covers' best practice? My first thought, when
I saw this code, was "how does the utility know that it will get any
data back from the server, let alone that it will be longer in length?"
The server sends a keyword that says "Content-Length: 1234" so that HTTP
clients will know that they should receive 1234 bytes in response.
If successful, the java servlet returns the message (data) back (we see
this in the GUI). Is the "Not all data written!" error caused by the
servlet sending because the RPG program is sending 'msg=iSeriesTest' and
the servlet is sending something back something smaller?
My guess is that you're not encoding the data that you're sending to the
servlet in the manner that it expects you to. This is causing the servlet
to crash or get "hung up" so that it stops receiving data from you.
Then, HTTPAPI complains that the server won't receive all of the data that
you're trying to send.
4) What suggestions do you have to resolve this issue? I was thinking
about commenting out the length checking logic from the HTTPAPIR4 member
but don't know if that would cause other HTTP errors, so wanted to check
with you first.
There are many different ways to encode the parameters that you're trying
to send to the server. Just because my server expects a string like
parm1=value1&parm2=value2&parm3=value3 doesn't mean that your servlet
does. It may be expecting a SOAP document, or some other XML document, or
it may be expecting something else entirely.
I'd run a packet sniffer (www.ethereal.com has a good, free one) to find
out exactly what your test program sends to the server, then make sure
that HTTPAPI sends the same thing.
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------