davsclaus commented on code in PR #30212:
URL: https://github.com/apache/camel/pull/30212#discussion_r4587572445


##########
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc:
##########
@@ -121,6 +121,21 @@ nodes, and XInclude is not processed. Before, the Flowable 
7 deserializer parsed
 An event that relies on an external DTD or an external entity no longer gets 
their content. A channel that sets
 `deserializerDelegateExpression` keeps its own deserializer, which can parse 
such events.
 
+=== camel-jaxb - the part class and namespace headers are used only when 
allowed
+
+The JAXB data format has a new option `allowPartClassFromHeader` (default 
`false`). The `CamelJaxbPartClass` and
+`CamelJaxbPartNamespace` headers are now used only when this option is `true`; 
otherwise they are ignored, and the
+`partClass` and `partNamespace` options of the data format apply. Before, the 
headers were always used, and took
+precedence over these options.
+
+Routes that set these headers to choose the part class or namespace per 
message must enable the option, for example
+`jaxb.setAllowPartClassFromHeader(true)` in Java, 
`allowPartClassFromHeader="true"` on `<jaxb>` in XML, or
+`allowPartClassFromHeader: true` in YAML. With REST binding, set the data 
format property
+`xml.out.allowPartClassFromHeader=true` on the REST configuration.

Review Comment:
   Thanks, you are right. The upgrade guide now says 
`xml.out.allowPartClassFromHeader=true` for a REST service (the response) and 
`xml.in.allowPartClassFromHeader=true` for the `rest` producer (the request). 
Fixed in 926ead4a7292.
   
   _Claude Code on behalf of davsclaus_



##########
core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/SoapDataFormat.java:
##########
@@ -66,6 +66,12 @@ public class SoapDataFormat extends DataFormatDefinition {
     @Metadata(label = "advanced", javaType = "java.lang.Boolean",
               description = "Whether to ignore headers that were not 
unmarshalled.")
     private String ignoreUnmarshalledHeaders;
+    @XmlAttribute
+    @Metadata(label = "advanced", javaType = "java.lang.Boolean",
+              description = "Whether the CamelJaxbPartClass and 
CamelJaxbPartNamespace headers are used, when set, instead of"
+                            + " the partClass and partNamespace options when 
marshalling and unmarshalling."
+                            + " This should only be enabled when desired to be 
used.")
+    private String allowPartClassFromHeader;

Review Comment:
   Agreed. Since enabling it never works on SOAP, 926ead4a7292 removes the 
option from the SOAP model, reifier and generated DSL files again. The SOAP 
data format always ignores the two headers now (the option stays at its default 
`false`). `SoapUnMarshalTest` has a new test: a request with both headers set 
is still unmarshalled to `GetCustomersByName`. The upgrade guide says that SOAP 
ignores these headers.
   
   _Claude Code on behalf of davsclaus_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to