internal CppType mapType(wsdlParser.qname type) { if (m_sf.IsAnyType(type.localname, type.@namespace)) { return(CppType.Create((int)VarEnum.VT_VARIANT, "VARIANT", CppType.ArrayType.NotArray, CppType.TypeStyle.Primative, false, type)); } CppType t = null; try { Object ct = m_sf.FindComType(type.localname, type.@namespace); if (ct is int) { return(CppType.TypeFromVariantType((int)ct, type)); } return(CppType.Create((int)VarEnum.VT_VARIANT, "VARIANT", type)); } catch (Exception ex) { // todo, catch specific exception // todo, handle complex types. // Console.WriteLine(type.ExpandedName + " : " + ex.Message); } // handle non-primitive types // first off, check the cache t = (CppType)m_typesCache[type.ExpandedName]; if (t != null) { return(t); } // look for a schema definition MSXML2.ISchema schema = SchemaForType(type); MSXML2.ISchemaType oType = (MSXML2.ISchemaType)schema.types.itemByQName(type.localname, type.@namespace); if (oType is MSXML2.ISchemaComplexType) { t = CreateComplexType(type, (MSXML2.ISchemaComplexType)oType); } else if (oType.enumeration.length > 0) { t = CreateEnumType(type, oType); } else if ((oType.itemType == MSXML2.SOMITEMTYPE.SOMITEM_SIMPLETYPE) && (oType.derivedBy == MSXML2.SCHEMADERIVATIONMETHOD.SCHEMADERIVATIONMETHOD_RESTRICTION)) { t = CreateRestrictedSimpleType(type, oType); } else { throw new ApplicationException("Sorry, this type " + type.ExpandedName + " is not yet supported"); } return(t); }
CppType CreateRestrictedSimpleType(wsdlParser.qname typeName, MSXML2.ISchemaType typeDesc) { throw new ApplicationException("Sorry, this type " + typeName.ExpandedName + " is not yet supported"); }