[resolved] 411 Length Required Exception in tRestClient Component

One Star

[resolved] 411 Length Required Exception in tRestClient Component

Hi All,
I got an error while sending a post request using tRestClient with the content-type and accept type are application/json.But when I try to send the same request with tRest component it's working fine.what could be the reason why I'm not able do the same request with the tRestClient component?
Because in tRest component I only get the error code but with the tRestClient component I also get error message including error code.So I can handle the exceptions very easily.
I tried with and wthout Content-Length header and in both the cases getting the same exception.
Attached the screen shot for your reference.
Can any one please help me on this?

Out bound message on console :


In bound message on console :


Thanks
Sayagoud Ravelly
Employee

Re: [resolved] 411 Length Required Exception in tRestClient Component

Hi
This is most likely due to the JSON payload exceeding a certain limit and HTTPUrlConnection starting using the chunked encoding which does not support Content-Length. Generally speaking the chunked encoding is more efficient for transferring the large payloads. Some legacy servers (non-Apache CXF based) can not deal with the chunked encoding and fail.
This issue has been raised recently and tRESTClient will allow disabling the chunked encoding in the coming ESB Studio release
HTH, Sergey
One Star

Re: [resolved] 411 Length Required Exception in tRestClient Component

Hi
This is most likely due to the JSON payload exceeding a certain limit and HTTPUrlConnection starting using the chunked encoding which does not support Content-Length. Generally speaking the chunked encoding is more efficient for transferring the large payloads. Some legacy servers (non-Apache CXF based) can not deal with the chunked encoding and fail.
This issue has been raised recently and tRESTClient will allow disabling the chunked encoding in the coming ESB Studio release
HTH, Sergey

Hi,
I'm able to do the same request with tRest component but why not with tRestClient?

HTTPUrlConnection starting using the chunked encoding which does not support Content-Length

I also tried by sending the payload with out Content-Length header but I got the same exception
is there any workaround for this exception with tRestClient?
Community Manager

Re: [resolved] 411 Length Required Exception in tRestClient Component

Hi 
As sberyozkin said, there was a issue on the tRestClient component right now, this issue will be fixed in the next release, it will allow disabling the cunhked encoding.

Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] 411 Length Required Exception in tRestClient Component

Hi 
As sberyozkin said, there was a issue on the tRestClient component right now, this issue will be fixed in the next release, it will allow disabling the cunhked encoding.

Best regards
Shong

Hi Shong,
Thanks for your reply.
Do we have any other way to get the error code and error message with the post request other than tRest and tRestClient?
Community Manager

Re: [resolved] 411 Length Required Exception in tRestClient Component

Do we have any other way to get the error code and error message with the post request other than tRest and tRestClient?

Sorry, I don't understand your question, can you please explain it with more details?
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] 411 Length Required Exception in tRestClient Component

Do we have any other way to get the error code and error message with the post request other than tRest and tRestClient?

Sorry, I don't understand your question, can you please explain it with more details?
Best regards
Shong

Hi Shong,
If I use the tRestClient component it is returning the error code and error message details but it is throwing me the 411 Length Required exception because of chunked encoding.
Do we have any other component to handle restful requests ,which will provide me the error code and error message details like tRestClient?.
One Star

Re: [resolved] 411 Length Required Exception in tRestClient Component

Hi All,
I resolved the issue with tRestClient by installing the latest version of Talend Open Studio :5.6.0 M4 (test version ) and updated the component accordingly in my previous version.
In new component there is an option called :Disable chunked encoding and we need to check this option as shown like below.