You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2010/04/06 16:18:34 UTC
[jira] Commented: (CXF-2753) Need a way to preserve parameters
wrapper in DocLiteralInInterceptor
[ https://issues.apache.org/jira/browse/CXF-2753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12853989#action_12853989 ]
Daniel Kulp commented on CXF-2753:
----------------------------------
While I'm OK with the patch, I would STRONGLY suggest that Camel be updated to set the type class instead. If it's not set, you get a DOMSource which is probably not the best implementation for Camel as it definitely breaks streaming and loads everything into memory and such. I would suggest setting it to just Source.class so you would end up getting a SAXSource that wrappers the XMLStreamReader which would preserve the streaming behavior.
> Need a way to preserve parameters wrapper in DocLiteralInInterceptor
> --------------------------------------------------------------------
>
> Key: CXF-2753
> URL: https://issues.apache.org/jira/browse/CXF-2753
> Project: CXF
> Issue Type: Improvement
> Components: Core
> Reporter: William Tam
> Assignee: Willem Jiang
> Fix For: 2.3, 2.2.8
>
> Attachments: CXF-2753.patch
>
>
> In DocLiteralInInterceptor, the following condition determines whether the wrapper is preserved when unmarshalling the parameters.
> {code}
> if (msgInfo.getMessageParts().get(0).getTypeClass() != null) {
> {code}
> Currently, the parameters that I will get depending on whether service class (TypeClass) is provided. It is questionable that the condition is suitable for all DataBindings. For example, my endpoint uses SourceDataBinding which does not require to specify service class. So, when service class is provided, I get one parameter that wraps multi parts.
> For example,
> {code}
> <GetPerson>
> <personId>foo</personId>
> <ssn>1234</ssn>
> </GetPerson>
> {code}
> Otherwise, I get 2 parameters (in the example)
> {code}
> <personId>foo</personId>
> <ssn>1234</ssn>
> {code}
> We should get consistent behavior regardless of whether service class is provided by users.
> Here is my proposal to add a property to override the built-in condition (as in the attached patch). Free feel to come up with a better fix if you see fit.
> {code}
> protected boolean shouldWrapParameters(MessageInfo msgInfo, Message message) {
> Object keepParametersWrapperFlag = message.get(KEEP_PARAMETERS_WRAPPER);
> if (keepParametersWrapperFlag == null) {
> return msgInfo.getMessageParts().get(0).getTypeClass() != null;
> } else {
> return Boolean.parseBoolean(keepParametersWrapperFlag.toString());
> }
> }
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.