Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to create a job which accept JSON request from tRestRequest and transfer same to tRestClient. This should be some simple process and I may be missing something here.
Sample Json
{
"Reference":"12345",
"Files":[
{
"FileName":"test.png",
"FileData":"iVBORw0KGgoAAAANI=",
"FileUrl":""
}
]
}
Probelm:
1- If I am using body --> Document , my client is receiving only first root
{"Reference":"12345",}
2- If I am using body --> String , my client is receiving Blank body
|body|
|=--=|
| |
'----'
Reference from Job
Thanks,
Za
Hi,
Issue was when I tried to call Job 2 (tRestRequest) from Job 1 (tRestClient). Job 2 was receiving blank body.
I am able to solve this problem by mapping tMap to tRestClient like this. I did not touch the body.
tMap. ----> tRest Client
string -> String -----> string String
Body. --> Document
Also Checked WRAP JSON request in tRequest in first job.
Job 1 is Talent and Job 2 was internal Talend Job. Job 2 was mocking actual outside server. Internal Talend Jobs are working fine.
New Problem
When i tried to call outside server from Job 1 (tRestClient )as per my attached picture. It is given me following error.
Exception in component tRESTClient_1 (testnew)
javax.ws.rs.client.ResponseProcessingException: No message body reader has been found for class org.dom4j.Document, ContentType: text/html;charset=utf-8
at org.apache.cxf.jaxrs.impl.ResponseImpl.reportMessageHandlerProblem(ResponseImpl.java:437)
at org.apache.cxf.jaxrs.impl.ResponseImpl.doReadEntity(ResponseImpl.java:390)
at org.apache.cxf.jaxrs.impl.ResponseImpl.readEntity(ResponseImpl.java:314)
hello,
in the restRequest check the "output flow" and name it to "body" and set type "String" -> see pic 1
sync columns on next components
on tRestClient check the "input schema" (should be "body" type "String") --> see pic 2
check pic 3 to see my tlogRow after restRequest
regards
Hi,
Issue was when I tried to call Job 2 (tRestRequest) from Job 1 (tRestClient). Job 2 was receiving blank body.
I am able to solve this problem by mapping tMap to tRestClient like this. I did not touch the body.
tMap. ----> tRest Client
string -> String -----> string String
Body. --> Document
Also Checked WRAP JSON request in tRequest in first job.
Job 1 is Talent and Job 2 was internal Talend Job. Job 2 was mocking actual outside server. Internal Talend Jobs are working fine.
New Problem
When i tried to call outside server from Job 1 (tRestClient )as per my attached picture. It is given me following error.
Exception in component tRESTClient_1 (testnew)
javax.ws.rs.client.ResponseProcessingException: No message body reader has been found for class org.dom4j.Document, ContentType: text/html;charset=utf-8
at org.apache.cxf.jaxrs.impl.ResponseImpl.reportMessageHandlerProblem(ResponseImpl.java:437)
at org.apache.cxf.jaxrs.impl.ResponseImpl.doReadEntity(ResponseImpl.java:390)
at org.apache.cxf.jaxrs.impl.ResponseImpl.readEntity(ResponseImpl.java:314)
hi,
are you able to call "outside server" via postman for example ?
put a tlogrow after tmap to see what your sending to trestclient
-in trestclient check advanced settings and check:
.log messages
.drop json request root
.wrap json response
basic settings:
content type : this value depend on server - try json
accepttype: this value depend on server - try json