You can set @XmlElement(required=true) which will generate minOccurs="1"
There is no way in jaxb to specify a maxOccurs. This is something that would need to be dealt with separately. I am currently exploring this myself. Here is some info so far that I have come across. http://java.net/projects/jaxb/lists/dev/archive/2011-01/message/1 http://java.net/jira/browse/JAXB-430 Cheers Jason On Fri, Jan 28, 2011 at 12:44 PM, chandraprabha <[email protected]> wrote: > > Hi All, > > > I am implementing the web service using CXF/JAX WS. > I have got the below dependency in my pom.file > > <dependency> > <groupId>org.apache.cxf</groupId> > <artifactId>cxf-rt-frontend-jaxws</artifactId> > <version>2.3.1</version> > </dependency> > <dependency> > <groupId>org.apache.cxf</groupId> > <artifactId>cxf-rt-transports-http</artifactId> > <version>2.3.1</version> > </dependency> > > When I generate the WSDL it shows minOccurs="0" > e.g <xs:element minOccurs="0" name="dateOfBirth" type="xs:dateTime" /> > > I want to know how I can set minOccurs=1 and maxOccurs > > Thanks, > Chandraprabha > > -- > View this message in context: > http://cxf.547215.n5.nabble.com/In-code-first-approch-how-to-specify-minOccurs-tp3360717p3360717.html > Sent from the cxf-user mailing list archive at Nabble.com. >
