How to access meta data (all key-value pairs) from the incoming request (lisa.vse.request) and pass the meta data (all the key-value pairs from request) in response using SDP. If it is possible, please share me the sample script.
How to access meta data (all key-value pairs) from the incoming request (lisa.vse.request) and pass the meta data (all the key-value pairs from request) in response using SDP. If it is possible, please share me the sample script.
No scripting needed. Use Request DataCopier DPH to copy metadata to properties.
(Best to use "request" as prefix)
Then use {{request_ downloaden
Could you please tell me how to use the metadata property in response ? Please provide more details or screenshots.
FYI...I'm trying to send meta data (all the key-value pairs from the incoming request) in response.
Thank you.
Actually there are more than 250 key-value pairs in the request meta data and these key-value pairs are dynamic depends on the incoming request.
I want to copy the meta data and pass the same in response at runtime.
Ok, I didn’t realize that you wanted to return an unknown number of unknown request header key-value pairs.
The solution with the Request Data Copier and then just using {{request_xyz}} in your response is when you know what you get and what you want to do with it.
Second simplest solution, put the following in your response:
{{=lisa_vse_request.getMetaData().toString();}}
This will dump the request metadata ParameterList as a long string of key-value pairs separated by ‘&’. Is that sufficient for your requirement?
If you want nicely formatted key-value pairs then you will have to a Execute Script step, scripted assertion or response-side Scripted DPH to loop over the lisa_vse_request.getMetaData() ParameterList object and format the output of each key and its value.
Cheers,
Danny
I just realized you can do some simple formatting putting each key-value pair on a different line:
{{=lisa_vse_request.getMetaData().toString().replace('&','\n');}}
And actually, you can go pretty wild with this, here is something similar but now it outputs a little xml structure
{{="
:
:
BUT, here the assumption is that the value of any request header does NOT contain any ‘&’ or ‘=’ character because that will kind of mess up the output. See the above Content-Type request header which originally contains the string “text/xml; charset=utf-8”
If it is for you to just quickly assess if some key-value pair is there that might still be ok? If it needs to be “official” then you still might have to resort to some scripting that loops over the ParameterList
Cheers,
Danny
Thanks Danny.
I'm able to get the meta data using {{=lisa_vse_request.getMetaData().toString().replace('&','\n');}} property. But I want to send this as response meta data.
Could you please let me know how to configure request meta data (key-value pairs) in response meta data (key-value pairs).
(or)
Now I have created a VS using R-R pairs (request and response are in fixed length) and Sidecar files. I'm getting expected response in RFHUtil-Data, MQMD and RFH tabs, but I'm getting RFHUtil-usr tab as blank. Please let me know how to add Usr header and properties in VSI.
I'm using DevTest Solutions V10.1.0 and the Transport Protocol is IBM Native Protocol.
Thanks
Shashavali
As you are putting an (or) in your request for help, I think you should focus on the second part, that seems to be your real requirement.
@All, if someone can give Shashavali some pointers on how to get some data in the MQ RFH Usr header?
@ Shashavali, I would contact CA Support for assistance on your question
Regarding moving metadata from request to response, does it make sense to blindly copy metadata? If it does then do as follows:
Add a Scripted Assertion to your “VS Image Response Selection” step.
Configure as “If False then Fail the Test”
Add following code:
for (int i = 0; i < lisa_vse_response.size() ;i++)
{
lisa_vse_response.get(i).getMetaData().addAll(lisa_vse_request.getMetaData());
}
return true;
This will add (blindly) all the metadata fields from your request to each of your responses.
Cheers,
Danny
Hi Danny,
I'm sorry to bother you.
Instead of meta data, I want to copy <usr></usr> folder from the incoming request to response. There are more than 150 user properties and I can't configure manually in VSI. This is the exact requirement. Please advise.
Thanks
Shashavali
Apologies but there’s way to little information for now. You have to share the structure of the source info. Where do you find this folder? Is that in the request body, in the metadata, ...? And where does it need to go?
Cheers,
Danny
Hi Danny,
I'm able to add the usr properties in Response tab. Please see the below screenshot for more information:
I could see the usr properties in the metadata of incoming request. PFB.
metaData=msg.characterSet=819>
<msg.replyToQueueManagerName=replyToQueueManagerName>
<msg.putApplicationType=6>
<msg.messageType=1>
<msg.putTime=13480176>
<msg.replyToQueueName=replyToQueueName>
<msg.correlationId=correlationId>
<msg.format=MQHRF2>
<msg.messageId=messageId>
<msg.putApplicationName=putApplicationName>
<msg.priority=0>
<msg.persistence=0>
<msg.putDate=20181110>
<Payload.RFH.StructLength=8532>
<Payload.RFH.CharacterSet=819>
<Payload.RFH.Format=MQSTR>
<Payload.RFH.NameValueCcsid=1208>
<Payload.LittleEndian=false>
<Payload.ByteAlign=true>
<Payload.Folders.1.Props.InputMQMD.Encoding=273>
<Payload.Folders.1.Props.InputMQMD.Encoding.template=String>
<Payload.Folders.1.Props.InputMQMD.CodedCharSetId=819>
<Payload.Folders.1.Props.InputMQMD.CodedCharSetId.template=String>
<Payload.Folders.1.Props.InputMQMD.Format=MQSTR >
<Payload.Folders.1.Props.InputMQMD.Format.template=String>
<Payload.Folders.1.Props.InputMQMD.Version=2>
<Payload.Folders.1.Props.InputMQMD.Version.template=String>
<Payload.Folders.1.Props.InputMQMD.Report=0>
<Payload.Folders.1.Props.InputMQMD.Report.template=String>
<Payload.Folders.1.Props.InputMQMD.MsgType=8>
<Payload.Folders.1.Props.InputMQMD.MsgType.template=String>
<Payload.Folders.1.Props.InputMQMD.Expiry=-1>
<Payload.Folders.1.Props.InputMQMD.Expiry.template=String>
<Payload.Folders.1.Props.InputMQMD.Feedback=0>
<Payload.Folders.1.Props.InputMQMD.Feedback.template=String>
<Payload.Folders.1.Props.InputMQMD.Priority=0>
<Payload.Folders.1.Props.InputMQMD.Priority.template=String>
.
.
.
.
<Payload.Folders.1.Props.InputMQMD.abcd=N>
<Payload.Folders.1.Props.InputMQMD.abcd.template=String>
<Payload.Folders.1.template=usr>
<Payload.Payload.class=String>
<Payload.class=RFH>
<channel.name=Request 1
Above is the sample request meta data.
Issue: I could see '.' in the usr properties. For example, <Payload.Folders.1.Props.InputMQMD.Encoding=273>. I'm unable to add the usr properties which has '.' (InputMQMD.Encoding) in the keys.
Please advise.
Regards
Shashavali
Hi Shashavali,
I have no experience with putting RFH headers, my advice is to open a CA Support issue regarding: “I'm unable to add the usr properties which has '.' (InputMQMD.Encoding) in the keys.”
Cheers,
Danny
Hi Danny,
How to modify the meta data in {{lisa.vse.response}} using SDP ?
I'm trying to modify the key of particular meta data in {{lisa.vse.response}}.
For example : I want to update this <Payload.Folders.1.Props.InputMQMDEncoding=273> to <Payload.Folders.1.Props.InputMQMD.Encoding=273>.
Please advise.
Regards
Shashavali
Hi Danny,
Regarding moving metadata from request to response, does it make sense to blindly copy metadata? If it does then do as follows:
Add a Scripted Assertion to your “VS Image Response Selection” step.
Configure as “If False then Fail the Test”
Add following code:
for (int i = 0; i < lisa_vse_response.size() ;i++)
{
lisa_vse_response.get(i).getMetaData().addAll(lisa_vse_request.getMetaData());
}
return true;
This will add (blindly) all the metadata fields from your request to each of your responses.
I will try this code and let you know.
Regards
Shashavali
Hi Danny,
How to modify the meta data in {{lisa.vse.response}} using SDP ?
I'm trying to modify the key of particular meta data in {{lisa.vse.response}}.
For example : I want to update this <Payload.Folders.1.Props.InputMQMDEncoding=273> to <Payload.Folders.1.Props.InputMQMD.Encoding=273>.
Please advise.
Regards
Shashavali
Ok, I didn’t realize that you wanted to return an unknown number of unknown request header key-value pairs.
The solution with the Request Data Copier and then just using {{request_xyz}} in your response is when you know what you get and what you want to do with it.
Second simplest solution, put the following in your response:
{{=lisa_vse_request.getMetaData().toString();}}
This will dump the request metadata ParameterList as a long string of key-value pairs separated by ‘&’. Is that sufficient for your requirement?
If you want nicely formatted key-value pairs then you will have to a Execute Script step, scripted assertion or response-side Scripted DPH to loop over the lisa_vse_request.getMetaData() ParameterList object and format the output of each key and its value.
Cheers,
Danny