This has been discussed before and I found out that it is not possible using
JAXB until some future release of CXF and JAXB. But there is a workaround by
overriding the getWrapperPartMinOccurs method:

public class ServiceConfiguration extends
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean
{
        @Override public long getWrapperPartMinOccurs(MessagePartInfo mpi)
        {
                return 1l;
        }
}

This works fine. But the problem is that I do not ALWAYS want to have
minOccurs = 1. So I need a way to specify  this. Somehow I need to add
something to the parameters in the interface that defines the web service,
and be able to retrieve that via the MessagePartInfo parameter. One of these
methods seem to provide possible hooks:

mpi.getMessageInfo()
mpi.getXmlSchema()
mpi.getExtensionAttributes()

or maybe even

mpi.getName()

Any suggestions on how to get info from the interface to the method?

-- 
View this message in context: 
http://old.nabble.com/Configuring-minOccurs-on-JAXB-binding-tp27793701p27793701.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to