Skip to main content

Jax-ws, wsgen and jaxb annotations

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
No replies
ElDiabloRobotico
Offline
Joined: 2014-04-14

I am creating a web service using NetBeans, Tomcat and jax-ws.

The problem I am having is am annotating a class Request containing a list with

<br />
    @XmlElementWrapper(name = "requestItems")<br />
    @XmlElement(name = "requestItem")<br />
    public List<RequestItem> getRequestItems()<br />
    {<br />
        return requestItems;<br />
    }<br />

But wsgen seems to ignore the annotations and I get a wsdl which instead of allowing

<br />
<requestItems><br />
     <requestItem>...</requestItem><br />
     <requestItem>...</requestItem><br />
     <requestItem>...</requestItem><br />
</requestItems><br />

only allows

<br />
<requestItems>...</requestItems><br />
<requestItems>...</requestItems><br />
<requestItems>...</requestItems><br />

with the contents of the RequestItem class being inside the tag(s).

What am I doing wrong here?