/** * This copes with an observed phenomenon in the schema built by the * ReflectionServiceFactoryBean. It is creating element such that: (a) the * type is not set. (b) the refName is set. (c) the namespaceURI in the * refName is set empty. This apparently indicates 'same Schema' to everyone * else, so thus function implements that convention here. It is unclear if * that is a correct structure, and it if changes, we can simplify or * eliminate this function. * * @param name * @param referencingURI */ public static XmlSchemaElement findElementByRefName(SchemaCollection xmlSchemaCollection, QName name, String referencingURI) { String uri = name.getNamespaceURI(); if ("".equals(uri)) { uri = referencingURI; } QName copyName = new QName(uri, name.getLocalPart()); XmlSchemaElement target = xmlSchemaCollection.getElementByQName(copyName); assert target != null; return target; }
/** * This copes with an observed phenomenon in the schema built by the * ReflectionServiceFactoryBean. It is creating element such that: (a) the * type is not set. (b) the refName is set. (c) the namespaceURI in the * refName is set empty. This apparently indicates 'same Schema' to everyone * else, so thus function implements that convention here. It is unclear if * that is a correct structure, and it if changes, we can simplify or * eliminate this function. * * @param name * @param referencingURI */ public static XmlSchemaElement findElementByRefName(SchemaCollection xmlSchemaCollection, QName name, String referencingURI) { String uri = name.getNamespaceURI(); if ("".equals(uri)) { uri = referencingURI; } QName copyName = new QName(uri, name.getLocalPart()); XmlSchemaElement target = xmlSchemaCollection.getElementByQName(copyName); assert target != null; return target; }
/** * This copes with an observed phenomenon in the schema built by the * ReflectionServiceFactoryBean. It is creating element such that: (a) the * type is not set. (b) the refName is set. (c) the namespaceURI in the * refName is set empty. This apparently indicates 'same Schema' to everyone * else, so thus function implements that convention here. It is unclear if * that is a correct structure, and it if changes, we can simplify or * eliminate this function. * * @param name * @param referencingURI */ public static XmlSchemaElement findElementByRefName(SchemaCollection xmlSchemaCollection, QName name, String referencingURI) { String uri = name.getNamespaceURI(); if ("".equals(uri)) { uri = referencingURI; } QName copyName = new QName(uri, name.getLocalPart()); XmlSchemaElement target = xmlSchemaCollection.getElementByQName(copyName); assert target != null; return target; }
/** * This copes with an observed phenomenon in the schema built by the * ReflectionServiceFactoryBean. It is creating element such that: (a) the * type is not set. (b) the refName is set. (c) the namespaceURI in the * refName is set empty. This apparently indicates 'same Schema' to everyone * else, so thus function implements that convention here. It is unclear if * that is a correct structure, and it if changes, we can simplify or * eliminate this function. * * @param name * @param referencingURI */ public static XmlSchemaElement findElementByRefName(SchemaCollection xmlSchemaCollection, QName name, String referencingURI) { String uri = name.getNamespaceURI(); if ("".equals(uri)) { uri = referencingURI; } QName copyName = new QName(uri, name.getLocalPart()); XmlSchemaElement target = xmlSchemaCollection.getElementByQName(copyName); assert target != null; return target; }
/** * This copes with an observed phenomenon in the schema built by the * ReflectionServiceFactoryBean. It is creating element such that: (a) the * type is not set. (b) the refName is set. (c) the namespaceURI in the * refName is set empty. This apparently indicates 'same Schema' to everyone * else, so thus function implements that convention here. It is unclear if * that is a correct structure, and it if changes, we can simplify or * eliminate this function. * * @param name * @param referencingURI * @return */ public static XmlSchemaElement findElementByRefName(SchemaCollection xmlSchemaCollection, QName name, String referencingURI) { String uri = name.getNamespaceURI(); if ("".equals(uri)) { uri = referencingURI; } QName copyName = new QName(uri, name.getLocalPart()); XmlSchemaElement target = xmlSchemaCollection.getElementByQName(copyName); assert target != null; return target; }
private boolean validatePartType(String namespace, String name, boolean isElement) { boolean partvalid = false; if (namespace.equals(WSDLConstants.NS_SCHEMA_XSD)) { if (isElement) { XmlSchemaElement schemaEle = schemaCollection.getElementByQName(new QName(WSDLConstants.NS_SCHEMA_XSD, name)); partvalid = schemaEle != null ? true : false; } else { if ("anyType".equals(name)) { return true; } XmlSchemaType schemaType = schemaCollection.getTypeByQName(new QName(WSDLConstants.NS_SCHEMA_XSD, name)); partvalid = schemaType != null ? true : false; } } else { if (isElement) { if (schemaCollection.getElementByQName(new QName(namespace, name)) != null) { partvalid = true; } } else { if (schemaCollection.getTypeByQName(new QName(namespace, name)) != null) { partvalid = true; } } } return partvalid; }
private boolean validatePartType(String namespace, String name, boolean isElement) { boolean partvalid = false; if (namespace.equals(WSDLConstants.NS_SCHEMA_XSD)) { if (isElement) { XmlSchemaElement schemaEle = schemaCollection.getElementByQName(new QName(WSDLConstants.NS_SCHEMA_XSD, name)); partvalid = schemaEle != null ? true : false; } else { if ("anyType".equals(name)) { return true; } XmlSchemaType schemaType = schemaCollection.getTypeByQName(new QName(WSDLConstants.NS_SCHEMA_XSD, name)); partvalid = schemaType != null ? true : false; } } else { if (isElement) { if (schemaCollection.getElementByQName(new QName(namespace, name)) != null) { partvalid = true; } } else { if (schemaCollection.getTypeByQName(new QName(namespace, name)) != null) { partvalid = true; } } } return partvalid; }
public static XmlSchemaType getXmlSchemaType(ServiceInfo serviceInfo, QName name) { XmlSchemaType result = null; if ((name != null) && (serviceInfo != null)) { SchemaCollection col = serviceInfo.getXmlSchemaCollection(); result = col.getTypeByQName(name); if (result == null) { //check the name, if it is an element XmlSchemaElement el = col.getElementByQName(name); if (el != null) { result = el.getSchemaType(); } } } return result; }
public void checkForExistence(MessagePartInfo part) { QName qn = part.getElementQName(); if (qn != null) { XmlSchemaElement el = schemas.getElementByQName(qn); if (el == null) { Class<?> clazz = part.getTypeClass(); if (clazz == null) { return; } boolean isFromWrapper = part.getMessageInfo().getOperation().isUnwrapped(); if (isFromWrapper && clazz.isArray() && !Byte.TYPE.equals(clazz.getComponentType())) { clazz = clazz.getComponentType(); } mapClass(part, clazz); } } }
public void checkForExistence(MessagePartInfo part) { QName qn = part.getElementQName(); if (qn != null) { XmlSchemaElement el = schemas.getElementByQName(qn); if (el == null) { Class<?> clazz = part.getTypeClass(); if (clazz == null) { return; } boolean isFromWrapper = part.getMessageInfo().getOperation().isUnwrapped(); if (isFromWrapper && clazz.isArray() && !Byte.TYPE.equals(clazz.getComponentType())) { clazz = clazz.getComponentType(); } mapClass(part, clazz); } } }
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; }
public void checkForExistence(MessagePartInfo part) { QName qn = part.getElementQName(); if (qn != null) { XmlSchemaElement el = schemas.getElementByQName(qn); if (el == null) { Class<?> clazz = part.getTypeClass(); if (clazz == null) { return; } boolean isFromWrapper = part.getMessageInfo().getOperation().isUnwrapped(); if (isFromWrapper && clazz.isArray() && !Byte.TYPE.equals(clazz.getComponentType())) { clazz = clazz.getComponentType(); } JAXBBeanInfo beanInfo = getBeanInfo(clazz); if (beanInfo == null) { if (Exception.class.isAssignableFrom(clazz)) { QName name = (QName)part.getMessageInfo().getProperty("elementName"); part.setElementQName(name); buildExceptionType(part, clazz); } return; } QName typeName = getTypeName(beanInfo); createBridgeXsElement(part, qn, typeName); } else if (part.getXmlSchema() == null) { part.setXmlSchema(el); } } }
SchemaCollection schema = serviceInfo.getXmlSchemaCollection(); XmlSchemaElement elementByName = schema.getElementByQName(partElement);
protected void initializeMessageTypes(ServiceInfo s, AbstractMessageContainer container, int partType) { if (container == null) { return; } SchemaCollection col = s.getXmlSchemaCollection(); for (MessagePartInfo part : container.getMessageParts()) { if (part.getXmlSchema() == null) { if (part.isElement()) { XmlSchemaAnnotated tp = col.getElementByQName(part.getElementQName()); part.setXmlSchema(tp); } else { XmlSchemaAnnotated tp = col.getTypeByQName(part.getTypeQName()); part.setXmlSchema(tp); } } } }
QName ename = new QName(beanInfo.getElementNamespaceURI(null), beanInfo.getElementLocalName(null)); XmlSchemaElement el2 = schemas.getElementByQName(ename); el.setNillable(false); el.getRef().setTargetQName(el2.getQName());
protected void initializeMessageTypes(ServiceInfo s, AbstractMessageContainer container, int partType) { if (container == null) { return; } SchemaCollection col = s.getXmlSchemaCollection(); for (MessagePartInfo part : container.getMessageParts()) { if (part.getXmlSchema() == null) { if (part.isElement()) { XmlSchemaAnnotated tp = col.getElementByQName(part.getElementQName()); part.setXmlSchema(tp); } else { XmlSchemaAnnotated tp = col.getTypeByQName(part.getTypeQName()); part.setXmlSchema(tp); } } } }
pi.setElementQName(part.getElementName()); pi.setElement(true); pi.setXmlSchema(schemas.getElementByQName(part.getElementName()));
} else if (part.getElementName() != null) { pi.setElementQName(part.getElementName()); XmlSchemaElement schemaElement = schemas.getElementByQName(part.getElementName()); if (null == schemaElement) { org.apache.cxf.common.i18n.Message errorMessage =
} else if (part.getElementName() != null) { pi.setElementQName(part.getElementName()); XmlSchemaElement schemaElement = schemas.getElementByQName(part.getElementName()); if (null == schemaElement) { org.apache.cxf.common.i18n.Message errorMessage =
} else if (part.getElementName() != null) { pi.setElementQName(part.getElementName()); XmlSchemaElement schemaElement = schemas.getElementByQName(part.getElementName()); if (null == schemaElement) { org.apache.cxf.common.i18n.Message errorMessage =