Refine search
if (definition.getTypes() != null) { for (Object o : definition.getTypes().getExtensibilityElements()) { if (o instanceof javax.wsdl.extensions.schema.Schema) { Element ele = ((javax.wsdl.extensions.schema.Schema) o).getElement(); Node newNode = doc.importNode(ele, true); doc.appendChild(newNode); Map<String, String> ns = definition.getNamespaces(); if (ns != null) { for (Entry<String, String> e : ns.entrySet()) { if (e.getKey() != null && !e.getKey().isEmpty()) { doc.getDocumentElement().setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, "xmlns:" + e.getKey(), e.getValue());
throws WSDLException Import importDef = def.createImport(); contextURI = def.getDocumentBaseURI(); Definition importedDef = null; InputStream inputStream = null; importedDef.setExtensionRegistry(extReg); Types types = importedDef.createTypes(); types.addExtensibilityElement( parseSchema(Types.class, documentElement, importedDef)); importedDef.setTypes(types); NamedNodeMap attrs = importEl.getAttributes(); registerNSDeclarations(attrs, def);
NamedNodeMap attrs = typesEl.getAttributes(); registerNSDeclarations(attrs, def); Types types = def.createTypes(); Element tempEl = DOMUtils.getFirstChildElement(typesEl); QName tempElType; types.setDocumentationElement(tempEl); types.addExtensibilityElement( parseSchema(Types.class, tempEl, def)); types.addExtensibilityElement(parseExtensibilityElementAsDefaultExtensiblityElement(Types.class, tempEl, def)); types.addExtensibilityElement( parseExtensibilityElement(Types.class, tempEl, def));
protected void printTypes(Types types, Definition def, PrintWriter pw) throws WSDLException { if (types != null) { String tagName = DOMUtils.getQualifiedValue(Constants.NS_URI_WSDL, Constants.ELEM_TYPES, def); pw.print(" <" + tagName); printExtensibilityAttributes(Types.class, types, def, pw); pw.println('>'); printDocumentation(types.getDocumentationElement(), def, pw); List extElements = types.getExtensibilityElements(); printExtensibilityElements(Types.class, extElements, def, pw); pw.println(" </" + tagName + '>'); } }
final Map<String, SchemaInfo> imports, final Definition def) { Types types = def.createTypes(); schema.setRequired(true); schema.setElementType(WSDLConstants.QNAME_SCHEMA); schema.setDocumentBaseURI(name); schema.setElement(schemaInfo.getElement()); String sn = el.getAttribute("namespace"); SchemaInfo schemaInfo = namespaceToSchemaInfo.get(sn); el.setAttribute("schemaLocation", referencedSchema.getDocumentBaseURI()); nd.setAttribute("xmlns", WSDLConstants.NS_SCHEMA_XSD); doc.appendChild(nd); schema.setElementType(WSDLConstants.QNAME_SCHEMA); Collection<String> defNamespaces = CastUtils.cast(def.getNamespaces().values()); schema.setElement(nd); types.addExtensibilityElement(schema); def.setTypes(types);
private void extractSchema(Definition def, SchemaCollection schemaCol) { Types typesElement = def.getTypes(); if (typesElement != null) { int schemaCount = 1; for (Object obj : typesElement.getExtensibilityElements()) { org.w3c.dom.Element schemaElem = null; if (obj instanceof Schema) { Schema schema = (Schema)obj; schemaElem = schema.getElement(); } else if (obj instanceof UnknownExtensibilityElement) { org.w3c.dom.Element elem = ((UnknownExtensibilityElement)obj).getElement(); if (elem.getLocalName().equals("schema")) { schemaElem = elem; synchronized (schemaElem.getOwnerDocument()) { for (Object prefix : def.getNamespaces().keySet()) { String ns = (String)def.getNamespaces().get(prefix); if ("".equals(prefix)) { if (!schemaElem.hasAttribute("xmlns")) { Attr attr = schemaElem.getOwnerDocument() .createAttributeNS(javax.xml.XMLConstants.XMLNS_ATTRIBUTE_NS_URI,
visitedWSDLs.add(definition.getDocumentBaseURI()); Types types = definition.getTypes(); Object extensibilityElement; if (types != null) { for (Iterator iterator = types.getExtensibilityElements().iterator(); iterator.hasNext();) Element schemaElement = ((Schema) extensibilityElement).getElement(); schemaMap.put(schemaElement.getAttribute(XSD_TARGETNAMESPACE), schemaElement); Iterator iter = definition.getImports().values().iterator(); Vector values = null; Import wsdlImport = null;
schema.setAttribute(TARGET_NAMESPACE, typens); schema.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "http://www.w3.org/2001/XMLSchema"); schema.setAttribute(ELEMENT_FORM_DEFAULT, UNQUALIFIED); globalSchema.setAttribute(ELEMENT_FORM_DEFAULT, UNQUALIFIED); Types types = def.createTypes(); globalSchemaImpl.getElement().setAttribute("xmlns:xsd", "http://www.w3.org/2001/XMLSchema"); types.addExtensibilityElement(schemaImpl);
schema.getElement().getOwnerDocument().getElementsByTagNameNS(XMLConstants.W3C_XML_SCHEMA_NS_URI, "import"); for (int i = 0; i < importsNl.getLength(); i++) { final Element importElt = (Element) importsNl.item(i); if (importElt.hasAttribute("schemaLocation")) { final Map<String, List<SchemaReference>> schemaImportsMap = schema.getImports(); final List<SchemaReference> schemaImports = schemaImportsMap.get(importElt.getAttribute("namespace")); for (final SchemaReference schemaImport : schemaImports) { if (schemaImport.getSchemaLocationURI() != null alreadyImportedXsds.add(schemaImport.getSchemaLocationURI()); WsdlInlineUtil.inlineImportedXsds(schemaImport.getReferencedSchema(), types, alreadyImportedXsds); types.addExtensibilityElement(schemaImport.getReferencedSchema()); schema.getElement().getOwnerDocument().getElementsByTagNameNS(XMLConstants.W3C_XML_SCHEMA_NS_URI, "include"); for (int i = 0; i < includeNl.getLength(); i++) { final Element includeElt = (Element) includeNl.item(i); alreadyImportedXsds.add(schemaReference.getSchemaLocationURI()); WsdlInlineUtil.inlineImportedXsds(schemaReference.getReferencedSchema(), types, alreadyImportedXsds); types.addExtensibilityElement(schemaReference.getReferencedSchema()); alreadyImportedXsds.add(schemaReference.getSchemaLocationURI()); WsdlInlineUtil.inlineImportedXsds(schemaReference.getReferencedSchema(), types, alreadyImportedXsds); types.addExtensibilityElement(schemaReference.getReferencedSchema());
if (def.getTypes() == null) { return; List<Schema> extElem = def.getTypes().getExtensibilityElements(); if (extElem.size() == 0) { schemaModel = null; Element root = schema.getElement(); Document doc = root.getOwnerDocument(); Element eImport = doc.createElementNS("http://www.w3.org/2001/XMLSchema", "import"); eImport.setAttribute("namespace", "http://schemas.xmlsoap.org/soap/encoding/"); eImport.setAttribute("schemaLocation", WsdlReader.class.getResource("encoding.xsd").toString()); root.insertBefore(eImport, root.getFirstChild()); xmlGrammarPreparser.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null); DOMInputSource src = new DOMInputSource(schema.getElement()); src.setBaseSystemId(aBaseSystemId); src.setSystemId(aBaseSystemId);
Types types = definition.createTypes(); Schema schema; try { schema = (Schema) definition.getExtensionRegistry().createExtension(Types.class, SCHEMA_NAME); } catch (WSDLException e) { throw new InstallException(e); schema.setElement(schemaElement); Element importElement = document.createElementNS(IMPORT_NAME.getNamespaceURI(), "xsd:import"); importElement.setAttribute("namespace", targetNamespace); importElement.setAttribute("schemaLocation", schemaLocation); schemaElement.appendChild(importElement); types.addExtensibilityElement(schema); definition.setTypes(types);
public Types getTypes(Document document, Definition def) { Types types = def.createTypes(); schema.setAttribute("targetNamespace", TNS); stdNullElement.setAttribute("name", "null"); stdNullElement.setAttribute("nillable", "true"); Element stdNullElement0 = document.createElement("xsd:complexType"); stdNullElement.appendChild(stdNullElement0); schema.appendChild(colCollectionComplexType); types.setDocumentationElement(schema); return types;
Types types = definition.createTypes(); Map.Entry<String, String> entry = (Map.Entry<String, String>)ite.next(); Element importelement = doc.createElement("xsd:import"); importelement.setAttribute("namespace", entry.getKey()); importelement.setAttribute("schemaLocation", entry.getValue()); element.appendChild(importelement); schema.setElement(element); types.addExtensibilityElement(schema); definition.setTypes(types); } catch (Exception e) { throw new ToolException(msg, e); definition.setTargetNamespace(wmodel.getTargetNameSpace()); definition.addNamespace(WSDLConstants.WSDL_PREFIX, WSDLConstants.NS_WSDL);
if (allTypes[i] != null) typesElement = allTypes[i].getDocumentationElement(); if (typesElement == null) List extList = allTypes[i].getExtensibilityElements(); for (Iterator iter = extList.iterator(); iter.hasNext();) typesElement.getElementsByTagNameNS( WSIConstants.NS_URI_XSD, "complexType"); if (type.getLocalPart().equals(typeElem.getAttribute("name")))
if (allTypes[i] != null) typesElement = allTypes[i].getDocumentationElement(); if (typesElement == null) ((Schema) extElem).getElement(); break; typesElement.getElementsByTagNameNS( WSIConstants.NS_URI_XSD, "complexType"); if (type.getLocalPart().equals(typeElem.getAttribute("name")))
__log.debug("Processing XSD schemas in " + def.getDocumentBaseURI()); Types types = def.getTypes(); ((List<ExtensibilityElement>)def.getTypes().getExtensibilityElements()).iterator(); iter.hasNext();) { ExtensibilityElement ee = iter.next(); String schemaTargetNS = doc.getDocumentElement().getAttribute("targetNamespace"); if (schemaTargetNS != null && schemaTargetNS.length() > 0) { _internalSchemas.put(new URI(schemaTargetNS), schema);
Map<String, String> wsdlNamespaces = wsdlDefinition.getNamespaces(); List<String> schemas = new ArrayList<String>(); List<Types> typesList = new ArrayList<Types>(); if (wsdlDefinition.getTypes() != null) typesList.add(wsdlDefinition.getTypes()); for (Object o : types.getExtensibilityElements()) boolean containsNamespace = schema.getElement().hasAttribute(XML_NS_PREFIX + entry.getKey()); schema.getElement().setAttribute(XML_NS_PREFIX + entry.getKey(), entry.getValue());
List schemas = types.getExtensibilityElements(); if (schemas != null) String thisNamespace = extElem.getElement().getAttribute(Constants.ATTR_TARGET_NAMESPACE); if (thisNamespace != null && !thisNamespace.equalsIgnoreCase(targetNamespace))
private void addImportsFromDefinition(Definition definition, List schemaList) throws DeploymentException { Map namespaceMap = definition.getNamespaces(); Types types = definition.getTypes(); if (types != null) { List schemas = types.getExtensibilityElements(); for (Iterator iterator = schemas.iterator(); iterator.hasNext();) { Object o = iterator.next(); if (o instanceof Schema) { Schema unknownExtensibilityElement = (Schema) o; QName elementType = unknownExtensibilityElement.getElementType(); if (new QName("http://www.w3.org/2001/XMLSchema", "schema").equals(elementType)) { Element element = unknownExtensibilityElement.getElement(); addSchemaElement(element, namespaceMap, schemaList); String elementNamespace = element.getNamespaceURI(); String elementLocalName = element.getNodeName(); if ("http://www.w3.org/2001/XMLSchema".equals(elementNamespace) && "schema".equals(elementLocalName)) { addSchemaElement(element, namespaceMap, schemaList); Map imports = definition.getImports(); if (imports != null) { for (Iterator iterator = imports.entrySet().iterator(); iterator.hasNext();) {
private void addImportsFromDefinition(final Definition definition) throws OpenEJBException { final Types types = definition.getTypes(); if (types != null) { for (final Object extensibilityElement : types.getExtensibilityElements()) { if (extensibilityElement instanceof Schema) { final Schema unknownExtensibilityElement = (Schema) extensibilityElement; final QName elementType = unknownExtensibilityElement.getElementType(); if (new QName("http://www.w3.org/2001/XMLSchema", "schema").equals(elementType)) { final Element element = unknownExtensibilityElement.getElement(); xmlSchemaCollection.read(element); final String elementNamespace = element.getNamespaceURI(); final String elementLocalName = element.getNodeName(); if ("http://www.w3.org/2001/XMLSchema".equals(elementNamespace) && "schema".equals(elementLocalName)) { xmlSchemaCollection.read(element); final Map<String, List<Import>> imports = definition.getImports(); if (imports != null) { for (final Map.Entry<String, List<Import>> entry : imports.entrySet()) {