javax.wsdl.Import.setNamespaceURI()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(232)

本文整理了Java中javax.wsdl.Import.setNamespaceURI()方法的一些代码示例,展示了Import.setNamespaceURI()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Import.setNamespaceURI()方法的具体详情如下:
包路径:javax.wsdl.Import
类名称:Import
方法名:setNamespaceURI

Import.setNamespaceURI介绍

[英]Set the namespace URI of this import.
[中]设置此导入的命名空间URI。

代码示例

代码示例来源:origin: wsdl4j/wsdl4j

importDef.setNamespaceURI(namespaceURI);

代码示例来源:origin: axis/axis

/**
 * Create and add an import
 * 
 * @param def <code>Definition</code>
 * @param tns target namespace
 * @param loc target location
 */
protected void writeImport(Definition def, String tns, String loc) {
  Import imp = def.createImport();
  imp.setNamespaceURI(tns);
  if ((loc != null) && !loc.equals("")) {
    imp.setLocationURI(loc);
  }
  def.addImport(imp);
}

代码示例来源:origin: org.apache.axis/axis

/**
 * Create and add an import
 * 
 * @param def <code>Definition</code>
 * @param tns target namespace
 * @param loc target location
 */
protected void writeImport(Definition def, String tns, String loc) {
  Import imp = def.createImport();
  imp.setNamespaceURI(tns);
  if ((loc != null) && !loc.equals("")) {
    imp.setLocationURI(loc);
  }
  def.addImport(imp);
}

代码示例来源:origin: org.apache.axis/com.springsource.org.apache.axis

/**
 * Create and add an import
 * 
 * @param def <code>Definition</code>
 * @param tns target namespace
 * @param loc target location
 */
protected void writeImport(Definition def, String tns, String loc) {
  Import imp = def.createImport();
  imp.setNamespaceURI(tns);
  if ((loc != null) && !loc.equals("")) {
    imp.setLocationURI(loc);
  }
  def.addImport(imp);
}

代码示例来源:origin: apache/cxf

public void addWSDLDefinitionImport(Definition rootDefn, Definition defn, String prefix, File file) {
  if (rootDefn.getImports().get(defn.getTargetNamespace()) == null && !".wsdl".equals(file.getName())) {
    // Only import if not already done to prevent multiple imports of the same file
    // in the WSDL. Also watch out for empty fileNames, which by this point in the
    // code would show up as ".wsdl".
    Import importDefn = rootDefn.createImport();
    if (!ignoreImports) {
      importDefn.setLocationURI(file.toURI().toString());
    }
    importDefn.setNamespaceURI(defn.getTargetNamespace());
    rootDefn.addImport(importDefn);
  }
  if (!rootDefn.getNamespaces().values().contains(defn.getTargetNamespace())) {
    rootDefn.addNamespace(prefix, defn.getTargetNamespace());
  }
  if (!importedDefns.containsKey(file)) {
    importedDefns.put(file, defn);
  }
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-ws-wsdlgen

private static boolean addImport(QName name,
                 Class type,
                 WSDLDefinition wsdlDef,
                 Definition newDef,
                 List<WSDLDefinition> imports) {
  String namespace = name.getNamespaceURI();
  if (newDef.getImports(namespace) == null) {
    WSDLDefinition impDef = findDefinition(wsdlDef, name, type);
    if (impDef != null) {
      Import imp = newDef.createImport();
      imp.setNamespaceURI(namespace);
      imp.setLocationURI(impDef.getURI().toString());
      imp.setDefinition(impDef.getDefinition());
      newDef.addNamespace("ns" + imports.size(), namespace);
      newDef.addImport(imp);
      imports.add(impDef);
      return true;
    } else {
      // import was not added because element not found
      return false;
    }
  }
  return true;
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

private static boolean addImport(QName name,
                 Class type,
                 WSDLDefinition wsdlDef,
                 Definition newDef,
                 List<WSDLDefinition> imports) {
  String namespace = name.getNamespaceURI();
  if (newDef.getImports(namespace) == null) {
    WSDLDefinition impDef = findDefinition(wsdlDef, name, type);
    if (impDef != null) {
      Import imp = newDef.createImport();
      imp.setNamespaceURI(namespace);
      imp.setLocationURI(impDef.getURI().toString());
      imp.setDefinition(impDef.getDefinition());
      newDef.addNamespace("ns" + imports.size(), namespace);
      newDef.addImport(imp);
      imports.add(impDef);
      return true;
    } else {
      // import was not added because element not found
      return false;
    }
  }
  return true;
}

代码示例来源:origin: org.apache.servicemix/servicemix-common

public static Definition createImportDef(Definition definition, String targetNamespace, String importUri)
  throws Exception {
  // Create definition
  Definition def = WSDLFactory.newInstance().newDefinition();
  def.setTargetNamespace(targetNamespace);
  // Add namespaces
  Map<?, ?> namespaces = definition.getNamespaces();
  for (Iterator<?> iter = namespaces.keySet().iterator(); iter.hasNext();) {
    String prefix = (String) iter.next();
    String uri = definition.getNamespace(prefix);
    def.addNamespace(prefix, uri);
  }
  def.addNamespace("tns", targetNamespace);
  def.addNamespace("tnspt", definition.getTargetNamespace());
  // Create import
  Import imp = def.createImport();
  imp.setNamespaceURI(definition.getTargetNamespace());
  imp.setLocationURI(importUri);
  imp.setDefinition(definition);
  def.addImport(imp);
  return def;
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

if (d.getDefinition() != null) {
  javax.wsdl.Import imp = facade.createImport();
  imp.setNamespaceURI(d.getNamespace());
  imp.setDefinition(d.getDefinition());
  imp.setLocationURI(d.getDefinition().getDocumentBaseURI());

代码示例来源:origin: org.apache.tuscany.sca/tuscany-interface-wsdl

if (d.getDefinition() != null) {
  javax.wsdl.Import imp = facade.createImport();
  imp.setNamespaceURI(d.getNamespace());
  imp.setDefinition(d.getDefinition());
  imp.setLocationURI(d.getDefinition().getDocumentBaseURI());

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

importDef.setNamespaceURI(namespace);

代码示例来源:origin: org.apache.cxf/cxf-rt-core

String tns = service.getInterface().getName().getNamespaceURI();
wsdlImport.setDefinition(portTypeDef);
wsdlImport.setNamespaceURI(tns);
wsdlImport.setLocationURI(service.getInterface().getName().getLocalPart() + ".wsdl");
definition.addImport(wsdlImport);

代码示例来源:origin: org.wso2.wsdl4j/wsdl4j

importDef.setNamespaceURI(namespaceURI);

代码示例来源:origin: org.jboss.ws.native/jbossws-native-core

importDef.setNamespaceURI(namespaceURI);

代码示例来源:origin: apache/cxf

String tns = service.getInterface().getName().getNamespaceURI();
wsdlImport.setDefinition(portTypeDef);
wsdlImport.setNamespaceURI(tns);
wsdlImport.setLocationURI(service.getInterface().getName().getLocalPart() + ".wsdl");
definition.addImport(wsdlImport);

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

String s1 = DOMUtils.getAttribute(element, "location");
if (s != null)
 import1.setNamespaceURI(s);

代码示例来源:origin: org.eclipse/org.eclipse.wst.wsi

String s1 = DOMUtils.getAttribute(element, "location");
if (s != null)
 import1.setNamespaceURI(s);

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

String tns = service.getInterface().getName().getNamespaceURI();
wsdlImport.setDefinition(portTypeDef);
wsdlImport.setNamespaceURI(tns);
wsdlImport.setLocationURI(service.getInterface().getName().getLocalPart() + ".wsdl");
definition.addImport(wsdlImport);

相关文章