private void updateSchemaLocation(XmlSchema s, XmlSchemaExternal xmlSchemaExternal) throws AxisFault { if (s != null) { String schemaLocation = xmlSchemaExternal.getSchemaLocation(); if (schemaLocation.indexOf("://") == -1 && schemaLocation.indexOf("?xsd=") == -1) { String newscheamlocation = this.getServiceEPR() + "?xsd=" + schemaLocation; xmlSchemaExternal.setSchemaLocation(newscheamlocation); } } }
private void updateSchemaLocation(XmlSchema s, XmlSchemaExternal xmlSchemaExternal) throws AxisFault { if (s != null) { String schemaLocation = xmlSchemaExternal.getSchemaLocation(); if (schemaLocation.indexOf("://") == -1 && schemaLocation.indexOf("?xsd=") == -1) { String newscheamlocation = this.getServiceEPR() + "?xsd=" + schemaLocation; xmlSchemaExternal.setSchemaLocation(newscheamlocation); } } }
private static void updateSchemaRefs(XmlSchema parentSchema, String name) { for (Iterator iter = parentSchema.getIncludes().getIterator(); iter.hasNext();) { Object obj = iter.next(); if (obj instanceof XmlSchemaExternal) { XmlSchemaExternal extSchema = (XmlSchemaExternal)obj; String location = extSchema.getSchemaLocation(); if (location.length() > 0 && location.indexOf(":/") < 0 && location.indexOf("?xsd=") < 0) { extSchema.setSchemaLocation(name + "?xsd=" + location); } if (extSchema.getSchema() != null) { updateSchemaRefs(extSchema.getSchema(), name); } } } }
private void findImports(XmlSchema schema, Set<XmlSchema> processedImports, Set<XmlSchema> processedIncludes) { processedImports.add(schema); List<XmlSchemaExternal> externals = schema.getExternals(); for (XmlSchemaExternal external : externals) { if (external instanceof XmlSchemaImport) { XmlSchemaImport schemaImport = (XmlSchemaImport) external; XmlSchema importedSchema = schemaImport.getSchema(); if (!"http://www.w3.org/XML/1998/namespace".equals(schemaImport.getNamespace()) && importedSchema != null && !processedImports.contains(importedSchema)) { inlineIncludes(importedSchema, processedIncludes, processedImports); findImports(importedSchema, processedImports, processedIncludes); xmlSchemas.add(importedSchema); } // remove the schemaLocation external.setSchemaLocation(null); } } }
private void findImports(XmlSchema schema, Set<XmlSchema> processedImports, Set<XmlSchema> processedIncludes) { processedImports.add(schema); List<XmlSchemaExternal> externals = schema.getExternals(); for (XmlSchemaExternal external : externals) { if (external instanceof XmlSchemaImport) { XmlSchemaImport schemaImport = (XmlSchemaImport) external; XmlSchema importedSchema = schemaImport.getSchema(); if (!"http://www.w3.org/XML/1998/namespace".equals(schemaImport.getNamespace()) && importedSchema != null && !processedImports.contains(importedSchema)) { inlineIncludes(importedSchema, processedIncludes, processedImports); findImports(importedSchema, processedImports, processedIncludes); xmlSchemas.add(importedSchema); } // remove the schemaLocation external.setSchemaLocation(null); } } }
private void findImports(XmlSchema schema, Set<XmlSchema> processedImports, Set<XmlSchema> processedIncludes) { processedImports.add(schema); XmlSchemaObjectCollection includes = schema.getIncludes(); for (int i = 0; i < includes.getCount(); i++) { XmlSchemaExternal external = (XmlSchemaExternal) includes.getItem(i); if (external instanceof XmlSchemaImport) { XmlSchemaImport schemaImport = (XmlSchemaImport) external; XmlSchema importedSchema = schemaImport.getSchema(); if (!"http://www.w3.org/XML/1998/namespace".equals(schemaImport.getNamespace()) && importedSchema != null && !processedImports.contains(importedSchema)) { inlineIncludes(importedSchema, processedIncludes, processedImports); findImports(importedSchema, processedImports, processedIncludes); xmlSchemas.add(importedSchema); } // remove the schemaLocation external.setSchemaLocation(null); } } }
/** * Adjusts a given schema location * * @param s * @param xmlSchemaExternal * @param nameTable */ private void adjustSchemaLocation(XmlSchema s, XmlSchemaExternal xmlSchemaExternal, Hashtable nameTable, Hashtable importedScheams, Hashtable sourceURIToNewLocationMap) { if (s != null) { String schemaLocation = xmlSchemaExternal.getSchemaLocation(); String newscheamlocation = customSchemaNamePrefix == null ? // use the default mode (this.getServiceEPR() + "?xsd=" + getScheamLocationWithDot( sourceURIToNewLocationMap, s)) : // custom prefix is present - add the custom prefix (customSchemaNamePrefix + getScheamLocationWithDot( sourceURIToNewLocationMap, s)); xmlSchemaExternal.setSchemaLocation(newscheamlocation); importedScheams.put(schemaLocation, newscheamlocation); } }
/** * Adjusts a given schema location * * @param s * @param xmlSchemaExternal * @param nameTable */ private void adjustSchemaLocation(XmlSchema s, XmlSchemaExternal xmlSchemaExternal, Hashtable nameTable, Hashtable importedScheams, Hashtable sourceURIToNewLocationMap) { if (s != null) { String schemaLocation = xmlSchemaExternal.getSchemaLocation(); String newscheamlocation = customSchemaNamePrefix == null ? // use the default mode (this.getServiceEPR() + "?xsd=" + getScheamLocationWithDot( sourceURIToNewLocationMap, s)) : // custom prefix is present - add the custom prefix (customSchemaNamePrefix + getScheamLocationWithDot( sourceURIToNewLocationMap, s)); xmlSchemaExternal.setSchemaLocation(newscheamlocation); importedScheams.put(schemaLocation, newscheamlocation); } }
SchemaInfo info = schemas.get(sourceURI); String relativeSchemaPath = WSDLUtil.computeRelativePathWithVersion(schemaInfo.getProposedRegistryURL(), info.getProposedRegistryURL(), registry); xmlSchemaExternal.setSchemaLocation(relativeSchemaPath);
WSDLUtil.computeRelativePathWithVersion(schemaInfo.getProposedRegistryURL(), info.getProposedRegistryURL(), registry); xmlSchemaExternal.setSchemaLocation(relativeSchemaPath);
xmlSchemaExternal.setSchemaLocation(newLocation); String innerFileNameToSave = (String)processedSchemaMap.get(sourceURI); String innerXSDPath = getXSDPath(registryBasePath, innerFileNameToSave);
xmlSchemaExternal.setSchemaLocation(newLocation); String innerFileNameToSave = (String)processedSchemaMap.get(sourceURI); String innerXSDPath = getXSDPath(registryBasePath, innerFileNameToSave);