Refine search
public void addType(XmlSchemaType type) { QName qname = type.getQName(); if (schemaTypes.contains(qname)) { throw new RuntimeException("Schema for namespace '" + syntacticalTargetNamespace + "' already contains type '" + qname.getLocalPart()); } schemaTypes.add(qname, type); }
private void addCorbaTypes(XmlSchema xmlSchemaTypes) throws Exception { Map<QName, XmlSchemaType> objs = xmlSchemaTypes.getSchemaTypes(); CorbaType corbaTypeImpl = null; for (XmlSchemaType type : objs.values()) { boolean anonymous = WSDLTypes.isAnonymous(type.getName()); corbaTypeImpl = helper.convertSchemaToCorbaType(type, type.getQName(), null, null, anonymous); if (corbaTypeImpl != null && !helper.isDuplicate(corbaTypeImpl)) { typeMappingType.getStructOrExceptionOrUnion().add(corbaTypeImpl); } } addCorbaElements(corbaTypeImpl, xmlSchemaTypes); }
xml += schemaType.toString(prefix, (tab + 1));
private static TypeInfo getTypeInfo(XmlSchemaType type) { if (type == null) { return null; } XmlSchemaType baseType = (XmlSchemaType)type.getBaseSchemaType(); QName name = type.getQName(); boolean simple = (type instanceof XmlSchemaSimpleType); if (baseType == null) { return new TypeInfo(name, simple, null); } else { return new TypeInfo(name, simple, getTypeInfo(baseType)); } }
CorbaType membertype = new CorbaType(); XmlSchemaType schemaType = element.getSchemaType(); QName schemaName = element.getQName(); if (schemaType == null) { if (element.getRef().getTarget() != null) { schemaType = findSchemaType(element.getRef().getTarget().getSchemaTypeName()); schemaName = element.getRef().getTargetQName(); if (schemaName.getNamespaceURI().isEmpty()) { schemaName = new QName(uri, schemaName.getLocalPart()); } else if (schemaType != null) { XmlSchemaType st = schemaType; boolean anonymous = WSDLTypes.isAnonymous(st.getName()); QName typeName = null; if (anonymous) { containingTypeName.getLocalPart() + "." + elemName.getLocalPart()); } else { typeName = st.getQName();
QName entryName = new QName(targetNamespace, "document"); XmlSchemaType schemaType = xmlSchema.getTypeByName(entryName); entrySequence.getItems().add(any); entryType.setParticle(entrySequence); entryType.setName(entryName.getLocalPart()); xmlSchema.getItems().add(entryType); xmlSchema.getSchemaTypes().put(entryName, entryType); XmlSchemaElement entryElement = new XmlSchemaElement(xmlSchema, false); entryElement.setName(parameterName); entryElement.setSchemaTypeName(schemaType.getQName()); entryElement.setMinOccurs(0); entryElement.setNillable(true); return schemaType.getQName();
QName operationQName = new QName(schema.getTargetNamespace(), node.toString()); boolean isDuplicate = false; if (schema.getElements().containsKey(operationQName)) { Operation operation = generateOperation(operationQName.getLocalPart(), isDuplicate); bindingOperation = generateBindingOperation(binding, operation, operationQName.getLocalPart()); } else { bindingOperation = generateBindingOperation(binding, operation, operation.getName()); XmlSchemaType schemaType = visitor.getSchemaType(); int pos = schemaType.getQName().getLocalPart().indexOf("Type"); QName elementQName = new QName(schemaType.getQName().getNamespaceURI(), schemaType.getQName().getLocalPart().substring(0, pos)); createFaultMessage(corbaType, operation, bindingOperation, elementQName); node = node.getNextSibling();
XmlSchemaType schemaType = schemaElement.getSchemaType(); QName schemaTypeQname = schemaElement.getSchemaTypeName(); if (schemaType == null) { if (schemaTypeQname != null) { qnameSuffix); } else if ((schemaType instanceof XmlSchemaSimpleType) || ((schemaTypeQname != null) && (schemaTypeQname.equals(new QName("http://www.w3.org/2001/XMLSchema", "anyType")))) ) { QName opName = message.getAxisOperation().getName(); partNameList.add(WSDLUtil.getPartQName(opName.getLocalPart(), qnameSuffix, schemaElement.getQName().getLocalPart())); } else if (schemaType == null) { throw new CodeGenerationException("Can not determine the schema type for the " schemaType.getName(), "complexType"));
protected void checkForElement(ServiceInfo serviceInfo, MessagePartInfo mpi) { SchemaInfo si = getOrCreateSchema(serviceInfo, mpi.getElementQName().getNamespaceURI(), getQualifyWrapperSchema()); XmlSchemaElement e = si.getSchema().getElementByName(mpi.getElementQName().getLocalPart()); if (e != null) { mpi.setXmlSchema(e); return; } XmlSchema schema = si.getSchema(); si.setElement(null); //cached element is now invalid XmlSchemaElement el = new XmlSchemaElement(schema, true); el.setName(mpi.getElementQName().getLocalPart()); el.setNillable(true); XmlSchemaType tp = (XmlSchemaType)mpi.getXmlSchema(); if (tp == null) { throw new ServiceConstructionException(new Message("INTRACTABLE_PART", LOG, mpi.getName(), mpi.getMessageInfo().getName())); } el.setSchemaTypeName(tp.getQName()); mpi.setXmlSchema(el); }
QName referencedQName = null; if (elt.getWireName() != null) { referencedQName = elt.getWireName(); QName schemaTypeQName = elt.getSchemaType() != null ? elt.getSchemaType().getQName() : elt.getSchemaTypeName(); if (schemaTypeQName != null) { String clazzName = (String) processedElementTypeMap.get(elt.getWireName()); SchemaConstants.ELEMENT_TYPE); } else { if (referencedQName.equals(SchemaConstants.XSD_SCHEMA)) { metainfHolder.registerMapping(referencedQName, null, throw new SchemaCompilationException(SchemaCompilerMessages. getMessage("schema.referencedElementNotFound", referencedQName.toString())); QName anyElementFieldName = new QName(ANY_ELEMENT_FIELD_NAME);
if (schemaType.getName() != null) { String className = findClassName(schemaType.getQName(), isArray(xsElt)); schemaType.addMetaInfo(SchemaConstants.SchemaCompilerInfoHolder.CLASSNAME_KEY, schemaType.addMetaInfo( SchemaConstants.SchemaCompilerInfoHolder.CLASSNAME_PRIMITVE_KEY, Boolean.TRUE); schemaType.setName(generatedTypeName.getLocalPart()); changedComplexTypeSet.add((XmlSchemaComplexType) schemaType); makeFullyQualifiedClassName(schemaType.getQName()); processedTypemap.put(schemaType.getQName(), fullyQualifiedClassName); metaInfHolder.setOwnQname(schemaType.getQName()); metaInfHolder.setOwnClassName(fullyQualifiedClassName); String className = findClassName(schemaType.getQName(), isArray(xsElt)); schemaType.setName(generatedTypeName.getLocalPart()); changedSimpleTypeSet.add((XmlSchemaSimpleType) schemaType); makeFullyQualifiedClassName(schemaType.getQName()); processedTypemap.put(schemaType.getQName(), fullyQualifiedClassName); metaInfHolder.setOwnQname(schemaType.getQName());
private Anonarray generateCorbaAnonarray(String name, Long size, CorbaType type, XmlSchemaType stype, Scope fQName) { Anonarray anonarray = new Anonarray(); anonarray.setQName(new QName(typeMap.getTargetNamespace(), name)); anonarray.setBound(size); anonarray.setType(stype.getQName()); //REVISIT, if we add qualification option, then change below. anonarray.setElemname(new QName("", ELEMENT_NAME)); if (type != null) { anonarray.setElemtype(type.getQName()); } else { ArrayDeferredAction anonarrayAction = new ArrayDeferredAction(anonarray); wsdlVisitor.getDeferredActions().add(fQName, anonarrayAction); } return anonarray; }
private void processElement(XmlSchemaElement element, XmlNode parentNode , XmlSchema schema) throws AxisFault { String targetNamespace = schema.getTargetNamespace(); XmlNode xmlNode; QName schemaTypeName = element.getSchemaTypeName(); XmlSchemaType schemaType = element.getSchemaType(); if (schemaTypeName != null) { xmlNode = new XmlNode(element.getName(), targetNamespace, false, (element.getMaxOccurs() == 1 ? false : true), schemaTypeName.getLocalPart()); parentNode.addChildToList(xmlNode); if (("http://www.w3.org/2001/XMLSchema").equals(schemaTypeName.getNamespaceURI())) { } else { XmlSchema schemaOfType; XmlSchemaType childSchemaType = schema.getTypeByName(schemaTypeName.getLocalPart()); if (childSchemaType == null) { schemaOfType = getXmlSchema(schemaTypeName); xmlNode = new XmlNode(element.getName(), targetNamespace, false, (element.getMaxOccurs() == 1 ? false : true), schemaType.getQName().getLocalPart()); parentNode.addChildToList(xmlNode); processSchemaType(schemaType, xmlNode, schema);
final QName qname = new QName(namespace, name + postfix.toString()); final XmlSchemaElement el = schemas.getElementByQName(qname); XmlSchemaType type = null; if (el != null) { type = el.getSchemaType(); return null; final QName typeName = type == null ? null : type.getQName();
XmlSchemaElement element = new XmlSchemaElement(schema, false); if (typeNode != null) { ParamTypeSpecVisitor visitor = new ParamTypeSpecVisitor(getScope(), element.setSchemaTypeName(stype.getQName()); if (stype.getQName().equals(ReferenceConstants.WSADDRESSING_TYPE)) { element.setNillable(true); complex.setParticle(sequence); QName qName = new QName(definition.getTargetNamespace(), name); XmlSchemaElement result = new XmlSchemaElement(schema, true); result.setSchemaType(complex); if (duplicateTypeTrackerMap.containsKey(qName.toString())) { result.setName(getScope().toString() + "." + name); qName = new QName(definition.getTargetNamespace(), getScope().toString() + "." + name);
if (element.getSchemaType() == null) { return false; QName typeName = element.getSchemaType().getQName(); if (new QName("http://www.w3.org/2005/05/xmlmime", "base64Binary").equals(typeName)) { return true;
private static void factorySetupType(XmlSchemaElement element, SchemaCollection schemaCollection, ParticleInfo elementInfo) { elementInfo.type = element.getSchemaType(); if (elementInfo.type == null) { if (element.getSchemaTypeName() == null // no type at all -> anyType || element.getSchemaTypeName().equals(Constants.XSD_ANYTYPE)) { elementInfo.anyType = true; } else { elementInfo.type = schemaCollection.getTypeByQName(element.getSchemaTypeName()); if (elementInfo.type == null && !element.getSchemaTypeName() .getNamespaceURI().equals(Constants.URI_2001_SCHEMA_XSD)) { JavascriptUtils.unsupportedConstruct("MISSING_TYPE", element.getSchemaTypeName() .toString(), element.getQName(), element); } } } else if (elementInfo.type.getQName() != null && Constants.XSD_ANYTYPE.equals(elementInfo.type.getQName())) { elementInfo.anyType = true; } }
public WSDLPart(Part part, Class javaType) throws InvalidWSDLException { this.part = part; QName elementName = part.getElementName(); if (elementName != null) { element = WSDLOperationIntrospectorImpl.this.getElement(elementName); if (element == null) { throw new InvalidWSDLException("Element cannot be resolved: " + elementName.toString()); } } else { // Create an faked XSD element to host the metadata element = new XmlSchemaElement(); element.setName(part.getName()); element.setQName(new QName(null, part.getName())); QName typeName = part.getTypeName(); if (typeName != null) { XmlSchemaType type = WSDLOperationIntrospectorImpl.this.getType(typeName); if (type == null) { throw new InvalidWSDLException("Type cannot be resolved: " + typeName.toString()); } element.setSchemaType(type); element.setSchemaTypeName(type.getQName()); } } XMLType xmlType = new XMLType(getElementInfo(element)); xmlType.setNillable(element.isNillable()); xmlType.setMany(element.getMaxOccurs() > 1); dataType = new DataTypeImpl<XMLType>(dataBinding, javaType, xmlType); }
XmlSchemaType containingType) { assert element != null; if (element.getSchemaTypeName() != null) { XmlSchemaType type = xmlSchemaCollection.getTypeByQName(element.getSchemaTypeName()); if (type == null) { Message message = new Message("ELEMENT_TYPE_MISSING", LOG, element.getQName(), element.getSchemaTypeName().toString()); throw new UnsupportedConstruct(message); referencingURI = containingType.getQName().getNamespaceURI(); unsupportedConstruct("ELEMENT_HAS_NO_TYPE", originalElement.getName(), containingType.getQName(), containingType);
private static CorbaType getCorbaSchemaType(XmlSchema xmlSchema, TypeMappingType typeMap, XmlSchemaType stype, Scope scopedName) { CorbaType ctype = null; if (stype.getQName().equals(Constants.XSD_STRING)) { ctype = new CorbaType(); ctype.setName(CorbaConstants.NT_CORBA_STRING.getLocalPart()); ctype.setQName(CorbaConstants.NT_CORBA_STRING); ctype.setType(Constants.XSD_STRING); } else { QName qname = stype.getQName(); ctype = findCorbaTypeForSchemaType(typeMap, qname, scopedName); } return ctype; }