Claus Ibsen created CAMEL-26144:
-----------------------------------
Summary: camel-cxfrs - with the Default binding an unchanged
request body fails with No message body writer, and the HTTP API producer sends
only the first element of a List body
Key: CAMEL-26144
URL: https://issues.apache.org/jira/browse/CAMEL-26144
Project: Camel
Issue Type: Bug
Components: camel-cxfrs
Reporter: Claus Ibsen
Fix For: 4.24.0
Found while adding the catalog body types of cxfrs (CAMEL-24961, PR #28395).
h4. 1. With the Default binding an unchanged request body fails with No message
body writer
With the Default binding the consumer body is a {{MessageContentsList}}.
{{DefaultCxfRsBinding.populateCxfRsResponseFromExchange}} (main 2a465aa4814c,
lines 86-90) returns the body as the response entity, so a route that does not
change it (e.g. only logs) fails with 500 "No message body writer has been
found for class MessageContentsList". Checked on 4.24.0-SNAPSHOT with a cxfrs
consumer and the Default binding.
Proposed: unwrap a {{MessageContentsList}} reply (its single element, no
content when empty) before returning it.
h4. 2. The HTTP API producer sends only the first element of a List body
{{DefaultCxfRsBinding.bindCamelMessageBodyToRequestBody}} (lines 220-226) takes
{{get(0)}} of a {{MessageContentsList}} or List body, so the other elements of
a List body (e.g. a JSON array of items) are dropped without error. Checked on
4.24.0-SNAPSHOT with the cxfrs HTTP API producer.
Proposed: unwrap only a {{MessageContentsList}} of one element and send any
other List as the entity.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)