
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi all. Today's inquiry is about REST Driver.
I need to send two dynamic headers in my request but i believe i'm not achieving it.
I cannot access the platform to check how my request is being received. I apologize in advance because my knowledge of Rest Driver is quite limited but i was searching through the documentation and found no examples regarding to what i want to achieve.
I know i have to send the headers in the driver-operation-data XML, so i'm doing it like this:
<driver-operation-data class-name="User" command="query" event-id="0" src-dn="">
<request>
<url-token/>
<header cookie="JSESSIONID=XXXXX"/>
<header cookie="iamlb=XXXX"/>
<value>XXXXXXX</value>
</request>
/driver-operation-data>
But when i see the log, seems like the second cookie is not being sent:
Rest_Driver: sub-execute
Rest_Driver: queryHandler
Rest_Driver: queryHandler: class-name == 'User'
Rest_Driver: Query: preparing POST to https://xxxxx.xxxx:xxx/xxx/xxx
Rest_Driver: Setting the following HTTP request properties:
Rest_Driver: Content-type:application/x-www-form-urlencoded
Rest_Driver: cookie:XXXXXXXX
Rest_Driver: Did a HTTP POST with 0 bytes of data to https://xxxxx.xxxx:xxx/xxx/xxx
Rest_Driver: Response code and message: 200 OK
SubscriptionShim.execute() returned:
Content type is defined at the resource for query.
This is the code that adds the headers:
<do-append-xml-element expression="../driver-operation-data[last()]/request[last()]" name="header"/>
<do-set-xml-attr expression="../driver-operation-data[last()]/request[last()]/header" name="cookie">
<arg-string>
<token-text xml:space="preserve">JSESSIONID=</token-text>
<token-local-variable name="JSESSIONID"/>
</arg-string>
</do-set-xml-attr>
<do-append-xml-element expression="../driver-operation-data[last()]/request[last()]" name="header"/>
<do-set-xml-attr expression="../driver-operation-data[last()]/request[last()]/header[last()]" name="cookie">
<arg-string>
<token-global-variable name="iamlb-cookie"/>
<token-text xml:space="preserve">=</token-text>
<token-local-variable name="iamlb"/>
</arg-string>
</do-set-xml-attr>
My question overall is, am i doing it right or do i have to add the second header in another way?
Thank you so much in advance.
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I think you should have only one cookie xml attribute, but multiple cookies should be delimited by semi-colon (";")
So something like that (writing from top of my mind):
<do-set-xml-attr expression="../driver-operation-data[last()]/request[last()]/header[last()]" name="cookie">
<arg-string>
<token-text xml:space="preserve">JSESSIONID=</token-text>
<token-local-variable name="JSESSIONID"/>
<token-text xml:space="preserve">;</token-text>
<token-global-variable name="iamlb-cookie"/>
<token-text xml:space="preserve">=</token-text>
<token-local-variable name="iamlb"/>
</arg-string>
</do-set-xml-attr>


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
<driver-operation-data class-name="User" command="query" event-id="0" src-dn="">
<request>
<url-token/>
<header cookie="JSESSIONID=XXXXX" cookie="iamlb=XXXX"/>
<value>XXXXXXX</value>
</request>
/driver-operation-data>
Just disable the second append of header element. That should do the trick.
<do-append-xml-element expression="../driver-operation-data[last()]/request[last()]" name="header"/>
Who are the Knowledge Partners
If you appreciate my comments, please click the Like button.
If I have resolved your issue, please click the Accept as Solution button.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Alex, thank you so much for your answer.
What i'm not acheiving is to get the second header beside the first one.
When disabling the Do Append XML Element Action, the second header overwrites the first one.
I know this is an XML question rather than a Rest Driver one, but still any help would be welcome.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I think you should have only one cookie xml attribute, but multiple cookies should be delimited by semi-colon (";")
So something like that (writing from top of my mind):
<do-set-xml-attr expression="../driver-operation-data[last()]/request[last()]/header[last()]" name="cookie">
<arg-string>
<token-text xml:space="preserve">JSESSIONID=</token-text>
<token-local-variable name="JSESSIONID"/>
<token-text xml:space="preserve">;</token-text>
<token-global-variable name="iamlb-cookie"/>
<token-text xml:space="preserve">=</token-text>
<token-local-variable name="iamlb"/>
</arg-string>
</do-set-xml-attr>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Following your suggestion did the trick! then i realized it was already defined in the RFC.
Greetings