use of org.apache.cxf.binding.corba.wsdl.CorbaType in project cxf by apache.
the class WSDLToCorbaHelper method isDuplicateException.
protected CorbaType isDuplicateException(CorbaType corbaTypeImpl) {
CorbaType duplicate = null;
String corbaName = corbaTypeImpl.getName();
String corbaType = corbaTypeImpl.getType().getLocalPart();
if (!typeMappingType.getStructOrExceptionOrUnion().isEmpty()) {
Iterator<CorbaType> i = typeMappingType.getStructOrExceptionOrUnion().iterator();
while (i.hasNext()) {
CorbaType type = i.next();
if (corbaName.equals(type.getName()) && corbaType.equals(type.getType().getLocalPart()) && type instanceof Struct) {
return type;
}
}
}
return duplicate;
}
use of org.apache.cxf.binding.corba.wsdl.CorbaType in project cxf by apache.
the class WSDLToCorbaHelper method processSequenceType.
protected CorbaType processSequenceType(XmlSchemaSequence seq, QName defaultName, QName schemaTypeName) throws Exception {
CorbaType type = null;
QName seqName = null;
if (schemaTypeName == null) {
seqName = createQNameCorbaNamespace(defaultName.getLocalPart() + "SequenceStruct");
} else {
seqName = createQNameCorbaNamespace(schemaTypeName.getLocalPart() + "SequenceStruct");
}
schemaTypeName = checkPrefix(schemaTypeName);
Struct struct = new Struct();
struct.setName(seqName.getLocalPart());
struct.setQName(seqName);
struct.setRepositoryID(REPO_STRING + seqName.getLocalPart().replace('.', '/') + IDL_VERSION);
struct.setType(schemaTypeName);
List<MemberType> members = processContainerAsMembers(seq, defaultName, schemaTypeName);
for (MemberType memberType : members) {
struct.getMember().add(memberType);
}
type = struct;
if (seq.getMaxOccurs() != 1 || seq.getMinOccurs() != 1) {
QName name = createQNameTargetNamespace(type.getQName().getLocalPart() + "Array");
CorbaType atype = createArray(name, type.getQName(), type.getQName(), seq.getMaxOccurs(), seq.getMinOccurs(), false);
if (atype != null && !isDuplicate(atype)) {
typeMappingType.getStructOrExceptionOrUnion().add(atype);
}
}
if ((struct != null) && (struct.getMember().isEmpty())) {
String msgStr = "Cannot create CORBA Struct" + struct.getName() + "from container with no members";
org.apache.cxf.common.i18n.Message msg = new org.apache.cxf.common.i18n.Message(msgStr, LOG);
throw new Exception(msg.toString());
}
return type;
}
use of org.apache.cxf.binding.corba.wsdl.CorbaType in project cxf by apache.
the class WSDLToCorbaHelper method processComplexContentStructSchemaAll.
private Struct processComplexContentStructSchemaAll(Struct corbaStruct, XmlSchemaAll all, QName defaultName, QName schematypeName) throws Exception {
CorbaType alltype = processAllType(all, defaultName, schematypeName);
MemberType allmem = new MemberType();
allmem.setName(alltype.getQName().getLocalPart() + "_f");
allmem.setIdltype(alltype.getQName());
allmem.setAnonschematype(true);
if (alltype.isSetQualified() && alltype.isQualified()) {
allmem.setQualified(true);
}
corbaStruct.getMember().add(allmem);
if (!isDuplicate(alltype)) {
typeMappingType.getStructOrExceptionOrUnion().add(alltype);
}
return corbaStruct;
}
use of org.apache.cxf.binding.corba.wsdl.CorbaType in project cxf by apache.
the class WSDLToCorbaHelper method processAllMember.
private MemberType processAllMember(XmlSchemaAll all, QName defaultName, QName schemaTypeName) throws Exception {
CorbaType corbatype = processAllType(all, defaultName, schemaTypeName);
MemberType member = new MemberType();
member.setName(corbatype.getQName().getLocalPart());
member.setIdltype(corbatype.getQName());
if (corbatype.isSetQualified() && corbatype.isQualified()) {
member.setQualified(true);
}
return member;
}
use of org.apache.cxf.binding.corba.wsdl.CorbaType in project cxf by apache.
the class WSDLToCorbaHelper method convertSchemaToCorbaType.
public CorbaType convertSchemaToCorbaType(XmlSchemaType stype, QName defaultName, XmlSchemaType parent, XmlSchemaAnnotation annotation, boolean anonymous) throws Exception {
CorbaType corbaTypeImpl = null;
if (!isAddressingNamespace(stype.getQName())) {
// need to determine if its a primitive type.
if (stype instanceof XmlSchemaComplexType) {
corbaTypeImpl = processComplexType((XmlSchemaComplexType) stype, defaultName, annotation, anonymous);
} else if (stype instanceof XmlSchemaSimpleType) {
corbaTypeImpl = processSimpleType((XmlSchemaSimpleType) stype, defaultName, anonymous);
} else if (xmlSchemaList.getElementByQName(stype.getQName()) != null) {
XmlSchemaElement el = xmlSchemaList.getElementByQName(stype.getQName());
// REVISIT, passing ns uri because of a bug in XmlSchema (Bug: WSCOMMONS-69)
corbaTypeImpl = processElementType(el, defaultName, stype.getQName().getNamespaceURI());
} else {
throw new Exception("Couldn't convert schema " + stype.getQName() + " to corba type");
}
}
if (corbaTypeImpl != null && !isDuplicate(corbaTypeImpl)) {
typeMappingType.getStructOrExceptionOrUnion().add(corbaTypeImpl);
}
return corbaTypeImpl;
}
Aggregations