{
element.setMaxCount((part.getMaxCount() == Integer.MAX_VALUE) ? 0 : part.getMaxCount());
element.setMinCount(part.getMinCount());
element.setDescription(part.getDescription());
XMLMessagePartMapping mapping = (XMLMessagePartMapping)part.getMapping();
element.setNillable(mapping.isNillable());
if (element.getItemType() != SchemaItem.ELEMENT_REF)
{
Interface iface = mapping.getInterface();
if (iface == null)
{
element.setType(getAtomicType(part));
}
else
{
CompositeType type = new CompositeType(null);
type.setAggregation(CompositeType.AGGREGATION_CHOICE);
for (Iterator itr = iface.getRequestTable().getMessageIterator(); itr.hasNext(); )
{
Message msg = (Message)itr.next();
CompositeMessagePart rootPart = msg.getRoot();
XMLMessagePartMapping rootPartMapping = (XMLMessagePartMapping)rootPart.getMapping();
if (rootPartMapping.getNamespace() != null)
{
CompositeType childType = createCompositeType(rootPart, msg);
Element child = new Element(rootPartMapping.getNodeName());
setElementProperties(child, rootPart);
child.setType(childType);
childType.getSchema().addItem(child);