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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Call Post tRestClient using tWriteJsonField

hi,

 

I am having this flow

 

flow.PNG

 

The output of the tWriteJSON is as accepted by the webservice, and is working on postman:

json.PNG

But when I run I have the error : javax.ws.rs.WebApplicationException: HTTP 400 Bad Request

 

On my Webservice call to Post teh request, I am getting this error :   org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing: public org.springframework.http.ResponseEntity

 

Am I missong something ?

here the input schema of the WS

ws input.PNG

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

The tWriteJSONField component should be setting the "string" column not the "body" column. Only XML should use the "body" column. JSON will always be sent to the "string" column.

View solution in original post

6 Replies
Anonymous
Not applicable
Author

You've broken the input schema again. Never push the previous component's schema to the tRestClient. Always take the schema from the tRestClient. Your columns are named correctly, but the types of wrong. The "string" column is correct as String. But the "body" column should be of class Document, not String. You need to supply your JSON to the string column.

Anonymous
Not applicable
Author

When I put the body as Document I get this compilation error : canot convert from String to document in the tMap composant

 

row_tWriteJSONField_2_Out.body = strWriter_tWriteJSONField_2_Out.toString();
Anonymous
Not applicable
Author

The tWriteJSONField component should be setting the "string" column not the "body" column. Only XML should use the "body" column. JSON will always be sent to the "string" column.

Anonymous
Not applicable
Author

Finally i should the String as output Column and i removed rootNode as I dont need it. the Post in the TRestclient is done. But I wonder why i am stil getting the javax.ws.rs.WebApplicationException: HTTP 400 Bad Request.

 

twritejsoncomp.PNG

Anonymous
Not applicable
Author

no more errors, it is done. Thanks for @rhall  for the help.

Anonymous
Not applicable
Author

No problem. Glad you got it sorted 🙂