2 Replies Latest reply on May 17, 2007 10:46 AM by bogusexception

    minOccurs and maxOccurs in EJB3 annotations?

      Has anyone been able to generate minOccurs and maxOccurs wsdl solely through the use of EJB3 annotations?

      I'm looking to not have to create extra .xsd files. The @WebService annotation would need to generate the minOccurs/maxOccurs, but I can't see in the books I have how to direct the @WebMethod annotations to do so.

      Again, the idea here is to keep the app as clean as possible, and avoid mucking about with .wsdl and .xsd files.

      Any ideas?

      TIA!

        • 1. Re: minOccurs and maxOccurs in EJB3 annotations?

          From the documentation of @XmleElement:


          Customize the element declaration to be required.

          If required() is true, then Javabean property is mapped to an XML schema element declaration with minOccurs="1". maxOccurs is "1" for a single valued property and "unbounded" for a multivalued property.

          If required() is false, then the Javabean property is mapped to XML Schema element declaration with minOccurs="0". maxOccurs is "1" for a single valued property and "unbounded" for a multivalued property.


          Regards

          Felix

          • 2. Re: minOccurs and maxOccurs in EJB3 annotations?

            fhh,

            Thanks for the reply.

            PostPosted: Tue May 15, 2007 17:39 PM Post subject: Re: minOccurs and maxOccurs in EJB3 annotations?
            From the documentation of @XmleElement:


            You know, I have all the EJB3 books out there, including Bill Burke's Enterprise JavaBeans 3.0, and none of them mention these extended annotations. They mention @WebService and @WebMethod, and even @WebParam, but nothing at a fine grained level.

            I also found a nice PDF "card" that shows most/all:

            www.easybeans.net/xwiki/bin/download/Main/Documentation/ejb3-annotations.pdf

            Not having any books mention these, it never even occurred to me to look! Where did you find the documentation you quoted? Is it in the source? But knowing now that these "extended" (for lack of a better term) annotations exist, begs the next question:

            Are there any examples of using these annotations in an XML file that would be deployed with a class? Would those examples, too, be in the documentation?

            Anyway, thanks so much for the post, as when I went out and searched for "XMLElement" I found all these wonderful extensions I had no idea existed!
            [/url]