03-21-2018 06:29 AM
In Ultra pipelines, is there a way to retain data that wasn’t parsed by the XML parser? I would also like to retain data that wasn’t converted to XML.
Consider this example pipeline:
The Binary to Document1 snap output looks like this:
[
{
"task_name": "...",
"content-length": "164190",
"origin": "chrome-extension://aicmkgpgakddgnaphhhpliifpcfhicfo",
"content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><integrationMessage>...</integrationMessage>",
"accept-language": "en-US,en;q=0.9",
"method": "POST",
"query": {},
"mytoken":"ABCD1234ABCD1234"
...
}
]
I want to be able to send mytoken in the header of a later REST Post, after I’m done extracting some data from the parsed XML. Is there a way mytoken can be retained?
The other challenge I have is that the REST endpoint in question only accepts XML request body which means I need to use the convert to XML snap. The problem is that I need to pass mytoken in the request header but it shouldn’t be in the body. In my testing I found that the entire document is converted to XML by the convert to XML snap so I’m in a bit of bind.
Before Convert To XML:
[{
"REQUEST": {
"REQUEST_DETAILS": {
"REQUEST_DETAIL": [
{
"ENTITY_ID": "123456123",
"FIRST_NAME":"John",
"LAST_NAME":"Doe"
}
...
]
}
}
}]
The output of Convert To XML:
[
{
"content-type": "text/xml; charset=utf-8",
"content": "<?xml version='1.0' encoding='UTF-8'?><REQUEST>...</REQUEST>"
}
]
Is there a way to get something like this?
[
{
"mytoken":"ABCD1234ABCD1234"
"content-type": "text/xml; charset=utf-8",
"content": "<?xml version='1.0' encoding='UTF-8'?><REQUEST>...</REQUEST>"
}
]
I would then be able to send mytoken in the REST Post request header.