Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, all,
I've created a job, that making request to external REST service, by request to this job, and returning body as the XML file. JobBut the response has a problem with encoding random chars inside a body. Although, writing response content to file(in tHttpRequest _1) works fine. Response from external REST service moves between components as String.
I've already try add to "Advanced settings" parameter "-Dfile.encoding=UTF-8", but it hasn't worked.
Anyone have an idea, why does it can work incorrectly?
Thanks, all, for trying to help. The problem really places inside the tHttpRequest code. It reads a chunk of bytes from response stream, converts them into String and concatenates them. This algorithm works well if the response contains only ASCII symbols or response length less then 1024 byte(hardcoded size of the chunk). In other situations, it can split symbol. I've moved creating String from bytes after reading the response and it's worked. I've attached my version of this component. The issue in bugtracker will be created later.
Yes. I added this header to tRESTResponse_1 component,
but it hasn't worked too.
External service returns correct XML. I guess, the problem appears inside components after tHttpRequest_1 or during moving between them. I'll try to watch transformation this response in debugger.
Thanks, all, for trying to help. The problem really places inside the tHttpRequest code. It reads a chunk of bytes from response stream, converts them into String and concatenates them. This algorithm works well if the response contains only ASCII symbols or response length less then 1024 byte(hardcoded size of the chunk). In other situations, it can split symbol. I've moved creating String from bytes after reading the response and it's worked. I've attached my version of this component. The issue in bugtracker will be created later.