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

Re: WSDL2RPG and cookies



Hello Kjartan,

My comments are in-line:

> After I contacted the programmer from the webservice he found out
> that the program that sends the item needs logon cookies.  So after
> some reading I found out that I have to specifi
> http_use_cookies(*ON).

Actually, http_use_cookies() has defaulted to *ON since version 1.16 of 
HTTPAPI.

> I put it in my program (tried in the program that does the login and
> the program which sends the item from itemmaster) but I get the same
> error.  The procedure is as follows:
>
>     1)      Run a program which calls the service program to logon to the
>     webservice

Can you tell us more about this program?   I assume it also uses 
HTTPAPI?  If so, you should be able to create a debug log, or look at 
the variables in debug to see the cookies being received, parsed, and 
stored in the cookie array.  Does all look okay with them?

>     2)      Then the same program calls the service program to send the
>     item from the itemmaster.

Okay.  Can you see it sending the cookie back (again, by looking at a 
debug log?)  This is really what you are trying to troubleshoot... why 
isn't a cookie being sent back?  If the cookie is still in memory, and 
not sent, you probably have to step through the code to determine why.

Also (Thomas already pointed this out) by default, Cookies are kept in 
the HTTPAPI *SRVPGM's memory. That means that both of your programs need 
to run in the same actgrp, and that actgrp needs to remain active 
between calls...  otherwise the cookies will be lost.

You can circumvent this by calling http_cookie_file() and asking HTTPAPI 
to store it's cookies on disk where they can be re-retrieved.  (Make 
sure you do this in both programs, and specify the same file.)

Your debug file doesn't show any cookies being transmitted...
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------