Can I use @XmlElementWrapper on web service operations?

Solution Verified - Updated -

Issue

I have an EJB3 that expose webMethod defined as follows

@WebService
@Stateless
public class CalcEJB3Bean implements CalcEJB3 {

 @XmlElementWrapper
    public List<CalcArgs> echoArgsList( List<CalcArgs> args) {
        return args;
   }
}

The return value is wrapped as expected but not the call argument. The specification says that this annotation can be applied on methods and its purpose is :

"Generates a wrapper element around XML representation. This is primarily intended to be used to produce a wrapper XML element around collections"

Why does it apply only on return value but not on arguments of type Collection?

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 5.x
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.