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

Re: HTTPAPI to SSL Website



Hi Jon,

This has little to do with your symptoms, but:

 From your description, you're calling https_init() after 
http_persist_open(), which does not make sense.  (https_init sets 
parameters that would be used by http_persist_open...  but since the 
https_init is occurring after the open, the open is using defaults, and 
the https_init is accomplishing nothing.)

You should either call https_init BEFORE http_persist_open(), or (for 
clarity) omit the call to https_init() altogether.

Also, since you're using the persistent versions of the APIs, please 
ensure that all of your connections are being made to the same HTTP 
server.  IF they're to different servers, please replace the 
http_persist_get() and http_persist_post() with http_url_get() and 
http_url_post().

As for the actual symptom you've described -- "session timed out", I 
really need more information.  If I have to guess, I'd say it's related 
to cookies...  but that's really a WAG.  If you could send a debug file 
that would help a lot.



Juracich, Jon wrote:
> OK, long story short: we have a requirement to interact with a web
> site from the IBM i, effectively acting as a browser. The site
> doesn't offer a web service to accomplish what we need, so we need to
> receive the HTML, pick through it for what we're looking for, and
> send back posts as if someone was sitting at a browser. The intent is
> to run this from within a "green-screen application.
> 
> I'm building several "prototypes" so that I can learn / test as I go,
> and I've hit my first major roadblock - the host server is telling me
> that my session has timed out.
> 
> The basic call structure of the program is as follows:
> 
> 
> http_persist_open()
> 
> https_init( APP_ID )
> 
> http_persist_get() <= which works great!
> 
> http_url_encoder_new() <= to send some data on the post (I think)
> 
> http_url_encoder_addvar_s() <= just one piece of data...
> 
> http_url_encoder_getptr
> 
> http_persist_post() <= the page that comes back here says that my
> session has timed out / expired.
> 
> http_url_encoder_free()
> 
> https_cleanup()
> 
> http_persist_close()
> 
> 
> I've tried various combinations of persistent sessions, etc., and
> this seems to work "the best". I've run the session under debug, and
> (to my untrained eye) everything "appears" to work OK, with the
> exception that the host site thinks that my session has expired. I
> can replicate this behavior with a browser if I sit on the site for a
> while, then try to get to the page that I'm requesting from the i.
> 
> If I'm just doing it wrong, I can live with that - this is my first
> real foray into HTTPAPI! Any assistance would be welcomed. If you
> need actual source code, debug files, etc., just LMK.
> 
> Thanks,
> 
> Jon Juracich 
> -----------------------------------------------------------------------
>  This is the FTPAPI mailing list.  To unsubscribe, please go to: 
> http://www.scottklement.com/mailman/listinfo/ftpapi 
> -----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------