[
https://issues.apache.org/jira/browse/CXF-6491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14631341#comment-14631341
]
Sergey Beryozkin commented on CXF-6491:
---------------------------------------
I've done more work to ensure a single Java method is generated per every
request representation inside a given WADL method. Accumulating multiple media
types on a single method in this case would be much more complex to do,
especially with a possible necessity to match such multiple request reps
against response reps and I'm not sure it is worth it.
Besides, as I mentioned earlier, the Java client working with a method with
multiple Consumes has no way to choose whether to send XML or JSON, etc,
without using a CXF-specific cast of a proxy to (Web)Client and manually
setting Accept and if there's a need to do it then IMHO it is cleaner to have a
dedicated method per the specific representation. When supportMultipleXmlReps
is not set then the media types are indeed accumulated but when it is set I
believe it has to be a single method per rep.
Have a look please at the updated code, let me know if it produces a compilable
source in your case.
> wadl2java produces incorrect Consumes annotation for multiple representations
> on POST methods
> ---------------------------------------------------------------------------------------------
>
> Key: CXF-6491
> URL: https://issues.apache.org/jira/browse/CXF-6491
> Project: CXF
> Issue Type: Bug
> Components: Tooling
> Affects Versions: 3.0.2, 3.0.5, 3.1.1
> Environment: CentOS 6.6, Java
> java version "1.7.0_71"
> OpenJDK Runtime Environment (rhel-2.5.3.2.el6_6-x86_64 u71-b14)
> OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
> Reporter: Pat Lynch
> Assignee: Sergey Beryozkin
> Fix For: 3.0.6, 3.1.2
>
> Attachments: PlcmHohoResource.java, plcm-hoho-v2.xsd,
> plcm-hoho-v3.xsd, plcm-hoho.wadl, plcm-hoho.xsd
>
>
> The wadl2java tool, with the supportMultipleXmlReps option, generates the
> wrong @Consumes annotation values for each of the POST methods that have
> multiple representations. The annotation for all of the methods contains all
> of the media types instead of the single media type that is appropriate for
> the specific method.
> I've tested the versions listed in the affected versions field, but it likely
> applies to other versions as well.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)