Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

using Rest with POST XML

Hi,
I have a job that is a REST service in which I use XML to pass data to and it returns XML. The data is posted to it using POST.
So in the job I mapped for the incoming an field named id
However I do not know how to pass the data to it. I did a POST (content type application/xml ) with an xml like this:
123
But the job in talend fills in null for the id. I am not exacly sure what the problem is, is my POST data structure not correct? or is it not possible to use the tRESTREquest directly like this with an incoming XML and should another component extract the XML fields from the RestRequest?

Labels (4)
12 Replies
Anonymous
Not applicable
Author

Hi,
We created tutorials about REST service; they might help you. Here is the link to the first one: http://talendforge.org/tutorials/tutorial.php?language=english&idTuto=104
Regards,

--
Marie
Anonymous
Not applicable
Author

Thank you, I will have a look!
Anonymous
Not applicable
Author

Hi
The id field in the input will only be filled if you have an ID in URL pattern, like
/foo/bar/{id}
The body will be however put in the flow, please use tXMLMap after tRESTRequest to parse it.
Renat
Anonymous
Not applicable
Author

Hi, I want to use POST with XML data with the REST service, so your solution will not work for me. But I found the problem, the body type of the rest service was set to String instead of Document.
I set it to Document and after that I can use tXmlMap to access the XMl fields.
Anonymous
Not applicable
Author

hi all,
I would like to create a trest service too, with a similar sheme.
Do you use trest to test the trest service ? can you provide an example of the structure of an http post via trest ?
i run the service in talend with http://localhost:8095/service and trest with the same (in talend too), i get the 415 error status
 25 mai 2012 16:07:13 org.apache.cxf.jaxrs.utils.JAXRSUtils findTargetMethod
ATTENTION: No operation matching request path "/service" is found, Relative Path: /service, HTTP Method: POST, ContentType: text/plain, Accept: text/html,image/gif,image/jpeg,*/*,*/*;q=.2,. Please enable FINE/TRACE log level for more details.

thanks in advance 0683p000009MACn.png
Anonymous
Not applicable
Author

i correct this error by adding an header : "content-type" "application/xml" 0683p000009MACn.png
is someone able to provide the configuration of txmlmap between trestrequest and trest response ? i am unable to qualify this content (received by tresrequest).
many thanks
_AnonymousUser
Specialist III
Specialist III

Hi,
after a tRestClient component, the response is available in a tlogRow.
But if I use a tXMLmap to get xml content, I have no error but no results.
Where is the problem?
Thanks for help
Anonymous
Not applicable
Author

Hi,
I have similar problems when I try to design a REST Service using PUT or POST methods to insert or update datas in a DB.
I did not find any tutorial about REST Service with output to DB and the PDF documentation about REST Components does not provide such scenario. Only the use case with http GET and a DB input is explained.
If anybody from Talend, who already exprimented this kind of REST Service, could explain the main steps, it would probably help many users !
Thanks
Anonymous
Not applicable
Author

Does anybody knows what is wrong in my example below ? The flow seems empty and all components are remaining in "Starting" status ... I tried both POST and PUT methods
0683p000009MAEy.jpg 0683p000009MA9C.jpg