use of org.apache.cxf.binding.corba.wsdl.CorbaType in project cxf by apache.
the class WSDLToCorbaHelper method processElementType.
private CorbaType processElementType(XmlSchemaElement stype, QName defaultName, String uri) throws Exception {
String name = null;
QName schemaTypeName = null;
XmlSchemaType schemaType = stype.getSchemaType();
if (stype.getQName() == null) {
if (stype.getRef().getTargetQName() == null) {
schemaTypeName = defaultName;
} else {
name = stype.getRef().getTargetQName().getLocalPart();
schemaType = findSchemaType(stype.getRef().getTargetQName());
}
} else {
name = stype.getQName().getLocalPart();
}
if (schemaTypeName == null) {
schemaTypeName = createQNameTargetNamespace(name);
}
CorbaType result = convertSchemaToCorbaType(schemaType, schemaTypeName, schemaType, null, false);
result.setQualified(getElementQualification(stype, uri));
return result;
}
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 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;
}
use of org.apache.cxf.binding.corba.wsdl.CorbaType in project cxf by apache.
the class WSDLToCorbaHelper method processChoice.
private CorbaType processChoice(XmlSchemaChoice choice, QName defaultName, QName schemaTypeName) throws Exception {
QName choicename;
if (schemaTypeName == null) {
choicename = createQNameCorbaNamespace(defaultName.getLocalPart());
} else {
choicename = createQNameCorbaNamespace(schemaTypeName.getLocalPart());
}
choicename = checkPrefix(choicename);
CorbaType corbatype = createUnion(choicename, choice, defaultName, schemaTypeName);
String repoId = REPO_STRING + corbatype.getQName().getLocalPart().replace('.', '/') + IDL_VERSION;
((Union) corbatype).setRepositoryID(repoId);
if (choice.getMaxOccurs() != 1 || choice.getMinOccurs() != 1) {
QName name = createQNameTargetNamespace(corbatype.getQName().getLocalPart() + "Array");
CorbaType arrayType = createArray(name, corbatype.getQName(), corbatype.getQName(), choice.getMaxOccurs(), choice.getMinOccurs(), false);
if (arrayType != null && !isDuplicate(arrayType)) {
typeMappingType.getStructOrExceptionOrUnion().add(arrayType);
}
}
return corbatype;
}
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;
}
Aggregations