Add multiple lines to "Set-Cookie" header on WebServices Connector

Which IIQ version are you inquiring about?

8.4p2

Share all details about your problem, including any error messages you may have received.

Dear experts,

we are currently struggling with a logon issue related to a target system which we are managing via the WebServices connector.

The target system provides logon/logout endpoints and returns three cookies (ss-id, ss-opt, ss-pid) which are returned upon successful authentication and have to be added to the call to any subsequent endpoint.

Our idea was to achieve the goal via a BeforeOperation rule and we are able to retrieve the cookies, however we do not yet understand how to add them to the requestEndpoint’s header(s).

We tried different approaches (e. g. the below one) but we are still looking for a way to add multiple header lines to the “Set-Cookie” header.
Any ideas?

//Adding them manually for debugging purposes
	requestEndPoint.addHeader("Set-Cookie", "ss-id=123; domain=dev.xyz.net; path=/");
	requestEndPoint.addHeader("Set-Cookie", "ss-opt=temp; domain=dev.xyz.net; path=/; expiry=Fri Jul 14 14:50:37 CEST 2045");
	requestEndPoint.addHeader("Set-Cookie", "ss-pid=321; domain=dev.xyz.net; path=/; expiry=Fri Jul 14 14:50:37 CEST 2045");

Your help/input is highly appreciated.

Thank you very much

Best regards,
Daniel

Dear colleagues,

my apologies - this was probably too easy.

We found out that we can add all those cookies to the “Cookie” header and the target system will accept that without any issues.

//...
String authString = "";
for (BasicClientCookie cookie : cookies) {
			//log1.debug("Cookie: " + cookie.getName() + ":" + cookie.getValue());
			//log1.debug("Class: " + cookie.getClass().getName());
			log1.debug("Full Cookie: " + cookie.toString());
			authString = cookie.getName() + "=" + cookie.getValue() + ";" + authString;
		}
requestEndPoint.addHeader("Cookie", authString);
// ...

Thanks and best regards,
Daniel