本文整理了Java中javax.wsdl.Types
类的一些代码示例,展示了Types
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Types
类的具体详情如下:
包路径:javax.wsdl.Types
类名称:Types
[英]This interface represents the <types> section of a WSDL document.
[中]此接口表示WSDL文档的<types>部分。
代码示例来源:origin: org.lorislab.corn/corn
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());
代码示例来源:origin: wsdl4j/wsdl4j
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);
代码示例来源:origin: wsdl4j/wsdl4j
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));
代码示例来源:origin: wsdl4j/wsdl4j
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 + '>');
}
}
代码示例来源:origin: apache/cxf
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);
代码示例来源:origin: org.apache.cxf/cxf-rt-databinding-jibx
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,
代码示例来源:origin: org.apache.axis2/axis2-kernel
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;
代码示例来源:origin: org.apache.airavata/airavata-gfac-schema-utils
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);
代码示例来源:origin: org.ow2.orchestra/orchestra-utils
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());
代码示例来源:origin: de.tudarmstadt.ukp.dkpro.core/de.tudarmstadt.ukp.dkpro.core.io.wsdl-asl
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);
代码示例来源:origin: org.fabric3/fabric3-interface-wsdl
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);
代码示例来源:origin: apache/ofbiz-framework
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;
代码示例来源:origin: org.objectweb.celtix/celtix-tools
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);
代码示例来源:origin: org.eclipse/org.eclipse.wst.wsi
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")))
代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator
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")))
代码示例来源:origin: org.jboss.soa.bpel/riftsaw-bpel-compiler
__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);
代码示例来源:origin: org.mule.modules/mule-module-ws
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());
代码示例来源:origin: org.eclipse/org.eclipse.wst.wsi
List schemas = types.getExtensibilityElements();
if (schemas != null)
String thisNamespace = extElem.getElement().getAttribute(Constants.ATTR_TARGET_NAMESPACE);
if (thisNamespace != null && !thisNamespace.equalsIgnoreCase(targetNamespace))
代码示例来源:origin: org.apache.geronimo.modules/geronimo-webservices-builder
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();) {
代码示例来源:origin: org.apache.openejb/openejb-axis
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()) {
内容来源于网络,如有侵权,请联系作者删除!