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

SV: Cookie problem?



Hi,
 
It works now with 
http_use_cookies(*OFF);   
 
Best regards,
Magne
________________________________

Fra: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx på vegne av Mike Krebs
Sendt: ma 07.01.2013 07:24
Til: HTTPAPI and FTPAPI Projects
Emne: RE: Cookie problem?



I don't know if it is in the current or previous EXAMPLEs ... I think Scott explained how to deal with them in one of those or maybe it was forum post. He keeps track of them in some IFS location maybe? You could try clearing them and see if it is better behaved.

From your code, I wouldn't expect a problem with going multiple times without sending back the cookies. It looks like you are authenticating each time to the web service...should not be a reason to carry the session ID forward.
________________________________________
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Magne Kofoed [ma-kofo@xxxxxxxxxxx]
Sent: Saturday, January 05, 2013 4:00 AM
To: HTTPAPI and FTPAPI Projects
Subject: Cookie problem?

Hi,

I have a problem that I beleave has to do with cookies.
I try to do multiple http_url_post_xml and the second time I do a http_url_post_xml  I get a parse error because the http server returns 200 OK but 0 data.
It works if i do a RCLACTGRP QILE (clears the cookie and header)  before I do http_url_post_xml, but is there another solution on this? .

The first time httpapi gets this cookie from the http server:
header_load_cookies() entered
cookie_parse() entered
cookie =  JSESSIONID=agqhYNJ5_ZWc1FU8jW; path=/; secure; HttpOnly
cookie attr jsessionid=agqhYNJ5_ZWc1FU8jW
cookie attr path=/
cookie attr secure=
cookie attr httponly=

The second time, httpapi sets the cookie like this:
Cookie: ÅVersion=0; jsessionid=agqhYNJ5_ZWc1FU8jW; ÅPath=/;

And  gets Content-Length: 0 and SetError() Æ66: XML parse failed at line 1, col 0: no element found

Enclosed is the debug file.

Here is my rpg:

SOAP =
 '<?xml version="1.0" encoding="UTF-8"?>'
+'<soapenv:Envelope xmlns:xsi='
+'"http://www.w3.org/2001/XMLSchema-instance"; '
+'xmlns:soapenv='
+'"http://schemas.xmlsoap.org/soap/envelope/"; '
+'xmlns:cas='
+'"http://casefiles.services.extranet.xxx.dk <http://casefiles.services.extranet.xxx.dk/> ">'<http://casefiles.services.extranet.xxx.dk <http://casefiles.services.extranet.xxx.dk/> >
+'<soapenv:Header/>'
+'<soapenv:Body>'
+'<cas:getCasefile soapenv:encodingStyle='
+'"http://schemas.xmlsoap.org/soap/encoding/";>'<http://schemas.xmlsoap.org/soap/encoding/>
+'<username xsi:type="xsd:string">' + %trim(wsUser) + '</username>'
+'<password xsi:type="xsd:string">' + %trim(wsPwd) + '</password>'
+'<fileno xsi:type="xsd:string">' + %trim(caseFileno) + '</fileno>'
+'</cas:getCasefile>'
+'</soapenv:Body>'
+'</soapenv:Envelope>';

HTTP_setCCSIDs(1208: 277);  // CCSID 1208 = UTF-8

http_xproc( HTTP_POINT_ADDL_HEADER
         : %paddr(Add_SOAPACT2) );

http_xmlReturnPtr(*ON);

// Send Soap xml to xxx
  rc = http_url_post_xml(
      'https://extranet.xxx.dk/services/CasefilesService'
       : %addr(SOAP) + 2
       : %len(SOAP)
       : *NULL
       : %paddr(GetInnerDoc)
       : %addr(filename)
       : HTTP_TIMEOUT
       : HTTP_USERAGENT
       : 'text/xml;charset=utf-8');

 if (rc <> 1);
   http_crash();
 endif;
 http_xmlReturnPtr(*OFF);
 if (http_parse_xml_stmf( %trim(fileName)
                       : 1252
                       : *null
                       : %paddr(Incoming2)
                       : *null ) < 0 );
   http_crash();
 endif;

Best regards,
Magne
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------


<<winmail.dat>>

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------