eclipse-ee4j / metro-jax-ws

metro-jax-ws
https://eclipse-ee4j.github.io/metro-jax-ws/
BSD 3-Clause "New" or "Revised" License
72 stars 40 forks source link

Support for arrays without useless bean in the middle #543

Open Tomas-Kraus opened 2 years ago

Tomas-Kraus commented 2 years ago

Hi,

this post describes the request quite well: https://java.net/projects/metro/lists/users/archive/2009-07/message/408

(To make sure this ticket won't depend on a page that may be gone anytime, let me briefly quote it here:


Subject: Wsimport always wraps array types inside an object? Date: Fri, 24 Jul 2009 14:08:42 PDT

I'm accessing a public API (from Yahoo), and I'm currently using Axis. I would like to switch to JAX-WS. When I try generating the client stubs using wsimport, I noticed there is no option to turn off the wrapping of array types inside an object. E.g.

When this type is used as an input or output parameter, and I run this through wsimport, I get an object named ArrayOfString and this object is used in the method signature, e.g. public ArrayOfString getData() {} when what I want is similar to what Axis does: public List getData() {} or public String[] getData() {} I have scoured the internet and JAX-WS docs, tried various binding options (like ) but I can't seem to figure out if this is possible. An example WSDL demonstrating the problem is here: [http://developer.searchmarketing.yahoo.com/docs/V5/wsdl/V5/BasicReportService.wsdl](http://developer.searchmarketing.yahoo.com/docs/V5/wsdl/V5/BasicReportService.wsdl) [Message sent by forum member 'xbryan' (xbryan)] [http://forums.java.net/jive/thread.jspa?messageID=357508](http://forums.java.net/jive/thread.jspa?messageID=357508) ------------------------------------------------------------------------------------------------------------------ Five years later there still doesn't seem to be an answer to it or any advice anywhere on the Internet, I'm increasingly suprised nobody is insisting on this getting solved somehow. I believe the following issue is about quite the same thing: #497 No activity has been there for a very long time. Now, ... I think if there is no official solution, can't you just make a non-standard extension for it? It could even be a suggestion for a future standard. Just something like some command line parameter/Maven plugin option that you can define to get arrays simplified in that fashion? In projects that use many arrays this would be a huge help, really. I'd be the first one to be very grateful. Since this extension would be unlikely to cause any interoperability issues (it'd be private to the webservice client), it shouldn't do any harm to anyone, and those who won't like it wouldn't need to enable it in the first place. Furthermore a standard implementation (once a standard is defined) could be added at any later time. I don't even see any price for such an extension, I can only see advantages, nobody profits from the "ArrayOf..." bean class in the middle, do they? Is there any use of it? Why isn't every effort made to eliminate it? Please consider fixing this, please really do. Thank you. (And if I got anything wrong and it can be done, please kindly point me to it. Thanks again.) #### Affected Versions [2.2.8] Source: [https://github.com/javaee/metro-jax-ws/issues/1152](https://github.com/javaee/metro-jax-ws/issues/1152) Author: glassfishrobot