[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: http_url_post spped



Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>


Thanks for your advice. One more question related to HTTP_persist_post that
I did not look into yet. The connection is established in a multitude of
interactive jobs, each user has to interactively validate the shipper in
NextLinx database. Would HTTP_persist_post keep the connection open across
all this jobs?

No, not unless you take pains to make it work that way. HTTPAPI is a normal RPG program, it runs in the job that calls it, just like any other program.


If you want to share a single connection across many jobs, you'd have to create a mever-ending program in a batch job that waits for data on data queues (or whatever comm media you prefer) and uses that data to make the HTTP requests, then sends back the results via the data queue.

I don't know if that would improve performance or not, I think you'd have to experiment.

If yes, when is the connection closed?

When you use the persist features, you have to explicitly open & close the connection by calling the http_persist_open() and http_persist_close() functions from HTTPAPI.


For validating a shipper, it looks like you're writing XML to stream file, then sending that stream file. I wonder if it'd be faster to just create the XML in a variable in your program and post that? You might also consider using the Expat XML parsing routines that come with HTTPAPI, because it will actually parse the XML in memory as it's being received over the wire. Seems like that would be a little faster than saving the data to disk, and reading it back in a separate parser.

EXAMPLE16 demonstrates constructing the XML in memory and parsing it via HTTPAPI. Might be worth a look...
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------