Refine search
parentType, elementType); schema.setElementType(elementType); schema.setElement(el); schema.setDocumentBaseURI(def.getDocumentBaseURI()); SchemaImport im = schema.createImport(); im.setId(DOMUtils.getAttribute(tempEl, SchemaConstants.ATTR_ID)); im.setNamespaceURI(DOMUtils.getAttribute(tempEl, Constants.ATTR_NAMESPACE)); im.setSchemaLocationURI(locationURI);
/** * Add an import to this LightWeightSchema * * @param importSchema the import to be added */ public void addImport(SchemaImport importSchema) { String namespaceURI = importSchema.getNamespaceURI(); List importList = (List) this.imports.get(namespaceURI); if (importList == null) { importList = new Vector(); this.imports.put(namespaceURI, importList); } importList.add(importSchema); }
private void addSchemaImport(Schema schema, SchemaInfo schemaInfo, Schema referencedSchema) { SchemaImport imp = schema.createImport(); imp.setId(schemaInfo.getSystemId()); imp.setNamespaceURI(schemaInfo.getNamespaceURI()); imp.setSchemaLocationURI(referencedSchema.getDocumentBaseURI()); imp.setReferencedSchema(referencedSchema); schema.addImport(imp); }
private void addWSDLSchemaImport(Schema wsdlSchema, String tns, File file) { if (!wsdlSchema.getImports().containsKey(tns)) { SchemaImport schemaimport = wsdlSchema.createImport(); schemaimport.setNamespaceURI(tns); if (file != null && !ignoreImports) { schemaimport.setSchemaLocationURI(file.toURI().toString()); } wsdlSchema.addImport(schemaimport); } }
private void addSchema(String docBaseURI, Schema schema) { Element schemaEle = schema.getElement(); if (schemaList.get(docBaseURI) == null) { schemaList.put(docBaseURI, schemaEle); String tns = schema.getDocumentBaseURI() + "#" + schema.getElement().getAttribute("targetNamespace"); if (schemaList.get(tns) == null) { schemaList.put(tns, schema.getElement()); Schema tempImport = schemaImport.getReferencedSchema(); String key = schemaImport.getSchemaLocationURI(); if (importNamespace == null && tempImport != null) { importNamespace = tempImport.getDocumentBaseURI();
schemaImpl.setRequired(true); schemaImpl.setElementType(WSDLConstants.QNAME_SCHEMA); schemaImpl.setElement(schemaInfo.getElement()); for (XmlSchemaExternal ext : schemaInfo.getSchema().getExternals()) { if (ext.getSchema() == null) { SchemaImport imp = schemaImpl.createImport(); imp.setNamespaceURI(((XmlSchemaImport)ext).getNamespace()); imp.setSchemaLocationURI(((XmlSchemaImport)ext).getSchemaLocation()); imp.setReferencedSchema(schemaImpl2); schemaImpl.addImport(imp);
private static Boolean setMtomEnabled(Schema schema) { if (schema != null) { if (hasExpectedContentTypes(schema.getElement())) { return true; } for (List<SchemaImport> c : ((Map<String, List<SchemaImport>>)schema.getImports()).values()) { for (SchemaImport simport : c) { if (setMtomEnabled(simport.getReferencedSchema())) { return true; } } } } return false; }
/** * Recursively add all imported schemas as schema resource. * This is necessary when schema import are located in jar files. If they are not added immediately the reference to them is lost. * * @param schema */ protected void addImportedSchemas(Schema schema) throws WSDLException, IOException, TransformerException, TransformerFactoryConfigurationError { for (Object imports : schema.getImports().values()) { for (SchemaImport schemaImport : (Vector<SchemaImport>)imports) { // Prevent duplicate imports if (!importedSchemas.contains(schemaImport.getNamespaceURI())) { importedSchemas.add(schemaImport.getNamespaceURI()); Schema referencedSchema = schemaImport.getReferencedSchema(); if (referencedSchema != null) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); Source source = new DOMSource(referencedSchema.getElement()); Result result = new StreamResult(bos); TransformerFactory.newInstance().newTransformer().transform(source, result); Resource schemaResource = new ByteArrayResource(bos.toByteArray()); addImportedSchemas(referencedSchema); schemaResources.add(schemaResource); } } } } }
String base) { OASISCatalogManager catalogs = OASISCatalogManager.getCatalogManager(bus); Collection<List<?>> imports = CastUtils.cast((Collection<?>)schema.getImports().values()); for (List<?> lst : imports) { List<SchemaImport> impLst = CastUtils.cast(lst); for (SchemaImport imp : impLst) { String start = imp.getSchemaLocationURI(); } catch (MalformedURLException e) { if (doneSchemas.put(decodedStart, imp) == null) { updateSchemaImports(imp.getReferencedSchema(), doneSchemas, base); if (doneSchemas.put(decodedStart, imp) == null) { doneSchemas.put(resolvedSchemaLocation, imp); updateSchemaImports(imp.getReferencedSchema(), doneSchemas, base); List<SchemaReference> includes = CastUtils.cast(schema.getIncludes()); for (SchemaReference included : includes) { String start = included.getSchemaLocationURI(); List<SchemaReference> redefines = CastUtils.cast(schema.getRedefines()); for (SchemaReference included : redefines) { String start = included.getSchemaLocationURI();
@SuppressWarnings("unchecked") private void addSchema(Schema schema) { Map<String, List> imports = schema.getImports(); if (imports != null && imports.size() > 0) { Collection<String> importKeys = imports.keySet(); for (String importNamespace : importKeys) { if (!isSchemaParsed(importNamespace + "?file=" + schema.getDocumentBaseURI())) { List<SchemaImport> schemaImports = imports.get(importNamespace); for (SchemaImport schemaImport : schemaImports) { Schema tempImport = schemaImport.getReferencedSchema(); if (tempImport != null && !isSchemaImported(tempImport)) { addSchema(tempImport); } } } } } if (!isSchemaImported(schema)) { schemaList.add(schema); } }
private void processSchema(javax.wsdl.extensions.schema.Schema schema, Collection<String> namespaceList) throws Exception { for (Iterator itImp = schema.getImports().values().iterator(); itImp.hasNext();) { Collection imps = (Collection) itImp.next(); for (Iterator itSi = imps.iterator(); itSi.hasNext();) { SchemaImport imp = (SchemaImport) itSi.next(); String namespaceUri = imp.getNamespaceURI(); namespaceList.add(namespaceUri); processSchema(imp.getReferencedSchema(), namespaceList); } } } }
private void addSchema(String docBaseURI, Schema schema) { Element schemaEle = schema.getElement(); if (schemaList.get(docBaseURI) == null) { schemaList.put(docBaseURI, schemaEle); String tns = schema.getDocumentBaseURI() + "#" + schema.getElement().getAttribute("targetNamespace"); if (schemaList.get(tns) == null) { schemaList.put(tns, schema.getElement()); Schema tempImport = schemaImport.getReferencedSchema(); String key = schemaImport.getSchemaLocationURI(); if (importNamespace == null && tempImport != null) { importNamespace = tempImport.getDocumentBaseURI();
schemaImpl.setRequired(true); schemaImpl.setElementType(WSDLConstants.QNAME_SCHEMA); schemaImpl.setElement(schemaInfo.getElement()); for (XmlSchemaExternal ext : schemaInfo.getSchema().getExternals()) { if (ext.getSchema() == null) { SchemaImport imp = schemaImpl.createImport(); imp.setNamespaceURI(((XmlSchemaImport)ext).getNamespace()); imp.setSchemaLocationURI(((XmlSchemaImport)ext).getSchemaLocation()); imp.setReferencedSchema(schemaImpl2); schemaImpl.addImport(imp);
private static Boolean setMtomEnabled(Schema schema) { if (schema != null) { if (hasExpectedContentTypes(schema.getElement())) { return true; } for (List<SchemaImport> c : ((Map<String, List<SchemaImport>>)schema.getImports()).values()) { for (SchemaImport simport : c) { if (setMtomEnabled(simport.getReferencedSchema())) { return true; } } } } return false; }
(Schema)def.getExtensionRegistry().createExtension(Types.class, new QName(Constants.URI_2001_SCHEMA_XSD, "schema")); SchemaImport schemaimport = wsdlSchema.createImport(); schemaimport.setNamespaceURI(ReferenceConstants.WSADDRESSING_NAMESPACE); schemaimport.setSchemaLocationURI(ReferenceConstants.WSADDRESSING_LOCATION); wsdlSchema.addImport(schemaimport);
private void addSchema(String docBaseURI, Schema schema) { Element schemaEle = schema.getElement(); if (schemaList.get(docBaseURI) == null) { schemaList.put(docBaseURI, schemaEle); String tns = schema.getDocumentBaseURI() + "#" + schema.getElement().getAttribute("targetNamespace"); if (schemaList.get(tns) == null) { schemaList.put(tns, schema.getElement()); Schema tempImport = schemaImport.getReferencedSchema(); String key = schemaImport.getSchemaLocationURI(); if (importNamespace == null && tempImport != null) { importNamespace = tempImport.getDocumentBaseURI();
schemaImpl.setRequired(true); schemaImpl.setElementType(WSDLConstants.QNAME_SCHEMA); schemaImpl.setElement(schemaInfo.getElement()); for (XmlSchemaExternal ext : schemaInfo.getSchema().getExternals()) { if (ext.getSchema() == null) { SchemaImport imp = schemaImpl.createImport(); imp.setNamespaceURI(((XmlSchemaImport)ext).getNamespace()); imp.setSchemaLocationURI(((XmlSchemaImport)ext).getSchemaLocation()); imp.setReferencedSchema(schemaImpl2); schemaImpl.addImport(imp);
parentType, elementType); schema.setElementType(elementType); schema.setElement(el); schema.setDocumentBaseURI(def.getDocumentBaseURI()); SchemaImport im = schema.createImport(); im.setId(DOMUtils.getAttribute(tempEl, SchemaConstants.ATTR_ID)); im.setNamespaceURI(DOMUtils.getAttribute(tempEl, Constants.ATTR_NAMESPACE)); im.setSchemaLocationURI(locationURI);
private void addSchemaImport(Schema schema, SchemaInfo schemaInfo, Schema referencedSchema) { SchemaImport imp = schema.createImport(); imp.setId(schemaInfo.getSystemId()); imp.setNamespaceURI(schemaInfo.getNamespaceURI()); imp.setSchemaLocationURI(referencedSchema.getDocumentBaseURI()); imp.setReferencedSchema(referencedSchema); schema.addImport(imp); }
wsdlSchema.setElement(el); SchemaImport schemaimport = wsdlSchema.createImport(); schemaimport.setNamespaceURI(xmlSchemaImport.getNamespace()); if (xmlSchemaImport.getSchemaLocation() != null && !ignoreImports) { schemaimport.setSchemaLocationURI(xmlSchemaImport.getSchemaLocation()); wsdlSchema.addImport(schemaimport);