Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have a problem with a tRestClient and the PUT method. It seems working but nothing is done.
As you can see, my job tRestClient is sending a "correct" response.
But when i look the result, nothing is changed.
Here is what i send (it's a Document type data):
+------+----------------------------------------------------------------------------------------+
| key | value |
+------+----------------------------------------------------------------------------------------+
| body | <?xml version="1.0" encoding="UTF-8"?>
<brand code="ELLE"><label>ELLES</label></brand> |
And there is what the tRestClient send me as a response:
200|<?xml version="1.0" encoding="UTF-8"?>
<root><id>B001A9D9-7EA7-4850-857C-401BF2A9B4A8</id><code>ELLE</code><label>EL</label><description>ELLE</description></root>
As you can see, the parameter <label> is not changed and i don't understand why!
hello,
you could try and use a tXMLMap and have several outputs depending on the field has value or not.
if you connect the tXMLMap to a trestclient :
trestclient input schema:
column -> body
type > Document
basic settings
contenttype > json
acceptype> json
advanced settings:
log messages
drop json request root
wrap json response
it will send a json request.
i make a call with txmlmap -> trestclient to make json request
Hi Shong,
My API is here to cancel & replace the data.
I send new datas to the API, it should return me the new datas.
When i do it manually, it works just fine.
So the response should be this :
200|<?xml version="1.0" encoding="UTF-8"?>
<root><id>B001A9D9-7EA7-4850-857C-401BF2A9B4A8</id><brand code="ELLE"><label>ELLES</label></brand></root>
and not
200|<?xml version="1.0" encoding="UTF-8"?>
<root><id>B001A9D9-7EA7-4850-857C-401BF2A9B4A8</id><code>ELLE</code><label>EL</label><description>ELLE</description></root>
My API is on a webpage, when i do it manually it looks like this :
{ "code"="ELLE", "label"="ELLES"}
My problem is, to construct this, i'll depend on the schema of the datas and i'm working on a job that will sometimes doesn't have all columns (based on xsd).
So sending a Document type allowed me to not send empty data.
exemple: if i have this in the "body" column
<brand code="ELLE"><label>ELLES</label></description></brand> ==> it should be { "code"="ELLE", "label"="ELLES"}
but if i use a tWriteJSON to generate this i'll have { "code"="ELLE", "label"="ELLES", "description":[]}
My goal is to avoid using a tWriteJSON and depend on the schema
Has you can see, in the API when i do it manually, the answer send me the corrected data, not like in Talend
The previous label was "EL" and as you can see, manually it changes to "ELLE"
hello,
you could try and use a tXMLMap and have several outputs depending on the field has value or not.
if you connect the tXMLMap to a trestclient :
trestclient input schema:
column -> body
type > Document
basic settings
contenttype > json
acceptype> json
advanced settings:
log messages
drop json request root
wrap json response
it will send a json request.
i make a call with txmlmap -> trestclient to make json request
It's working! Thanks a lot!
My mistake was that the option "Drop JSON Request Root" was uncheked