Talend: Iterating and parsing values from array to different points tXMLMap - etl

Iam working with tXMLMap and try to parse through input arrays and segregate to different output places.But Iam only getting access to first element. How can I access all data.
mysimple tXML map and flow is shown below.
The tXML map is shown below.
The post request is shown below.
Iam only getting the first object in the array as output. Second is missing. What am I doing wrong here?
EDIT:
I have ticked wrap json request in the tRESTREQUEST and in the tLogrow log is given as below.
<?xml version="1.0" encoding="UTF-8"?>
<root><Object><date><item>item1</item><itemID>1</itemID></date><date><item>item2</item><itemID>2</itemID></date></Object></root>
Both objects are logged. I have also added a root document above the Object in the input of tXMLMap(row:main1) but still the output is the same, only one element is send back in response.

Related

Return multiple json.UnmarshalTypeError errors

Just getting to grips with GO and loving it. I've come across a small issue and I can't seem to over come it.
I have an array of errors returning using validator.Validate. I have a POST endpoint which has two required fields. If none of these fields are in the body, I will get back an array of errors stating these are required.
My Issue However, If I send over the incorrect data type on one of these (string), it will validate the input one by one. For example:
This is working as intedned with nothing sent in the body
Image1
And below, is sending over name and testingvalidation as an integer
Image2
How do I get my code to not just validate the one above? I noticed if the error is a type of json.UnmarshalTypeError then it will only return one error

graphql - Add items to `errors` array while still returning data

I'm writing a graphQL API using Apollo server and I would like to know is there a way to add an error to the errors array returned in the response, without throwing an actual error and failing the entire resolver.
In my code I iterate an input array and in case I encounter an unsupported item, I wish to add it to the errors array returned in the response, while still returning data for the other valid items.
Please advise if and how I can do that.
Thanks in advance.

Extract response when response contain only a single value

How to extract the response in Load Runner when there is only one value in response.
For example response contains value "3".I need this value in next request.How can I correlate that.
In the case where there is no other data returned in the message body, you can use empty left and right boundaries to capture everything that is returned. You will of course need to do some validation on the returned value.
web_reg_save_param_ex(
"ParamName=cValue",
"LB=",
"RB=",
SEARCH_FILTERS,
"Scope=body",
LAST);
In addition to what has been described by Joel, you can also try this:
Snapshot View --> HTTP Data --> Response Body --> Select the response value to be correlated --> Right click --> Create Correlation
This would create the correlation code automatically on to the script at the required place.
There is always a left and right boundary for you to hook to, example
..."lb=<html>","rb=</html>",...
What did you try before asking and what were the results of those experiments?

How can I log the value of a variable sent in an HTTP Request sent from JMeter, if the value was first read in from a csv file

I would like to read the exact value of a variable I use to pass through an HTTP Request. I first read in many values of variables using the CSV Data Set Config. For the username, it is in the form of an email address. So, I have a variable called "email" in the Data Set Config. In the actual HTTP Request, for "name", I call it "username". For the "Value" field for this same "username", I added a time() function to it like this so I would end up creating unique users in my tests:
${email}${__time()
When I view the "Request" in a View Results Tree, I can see my parameter is listed correctly:
username=email1%40email.com1390854377360
I do not care if this is correct in real world terms. I already know that is not a valid email. That is ok for now.
What I want to know is how can I log that email that I just created on the fly? I would like to not have to pull in the whole request every time also and then use some type of Regular Expression extractor. It just seems like there should be an easy way to do this.
I think there are 2 ways,
Beanshell Pre/Post processors : you can write custom code in which you can log all your variables in some custom log file
Simple data writer : you can configure it and check save url,save field names,save response data field checkboxes that will give you complete data but in that later postprocessing on result file is required to get all usernames (email in your case).
first approach is easier and allows you create your own logging format(easy to retrieve and use somewhere else).
second approach is somewhat tedious and requires post processing.

Kendo UI Datasource and Arrays

I am sending over a series of array values from a posted form to an MVC3 Controller. I was hoping the default modelbinder would be able to parse this but I'm having some difficulty with it.
The array is in the following format:
order[0].[type]=some value.
I think this is the reason the model binder is not parsing my values because I'm not getting anything populated in my model.
What would be another way to handle this?
Probably need to post more of your code so I can see what you are doing exactly. However saying this you need to pass the model to the view/partial view on the response you are trying to retrieve on the post request.
If not you will have to iterate through the Form Collection that will be returned and the Actions Methods type e.g. ActionMethodName(FormCollection form), one issue is name versus id its the name of the Kendo UI control that is used to get the value not the id.
1As far as I remember the right format was:
orders[0].OrderID=13;
orders[0].Name="test";
orders[1].OrderID=15;
orders[1].Name="again test";
The indexing should start from 0 and increase by 1.
Check this out: http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx

Resources